2017-10-14 2 views
0

그냥 hugo quickstart 튜토리얼을 시작합니다.hugo에서 index.html 수정

here을 보면 _index.md 파일을 작성하여 home/default/root index.html을 수정할 수 있어야한다고 제안합니다.

$ hugo new site quickstart 
Congratulations! Your new Hugo site is created in ~/quickstart. 

Just a few more steps and you're ready to go: 

1. Download a theme into the same-named folder. 
    Choose a theme from https://themes.gohugo.io/, or 
    create your own with the "hugo new theme <THEMENAME>" command. 
2. Perhaps you want to add some content. You can add single files 
    with "hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>". 
3. Start the built-in live server via "hugo server". 

자, 홈 페이지를 수정 해 봅시다.

[~/quickstart]$ hugo new index.md 
[~/quickstart/content/index.md created 

[~/quickstart]$ hugo new _index.md 
[~/quickstart/content/_index.md created 

난의 영향으로, 그 모두를 편집 한 :

--- 
title: "Welcome" 
date: 2017-10-13T20:31:39-05:00 
draft: false 
--- 

# This is a website! 

Why nothing appears? 

하지만

[~/quickstart]$ hugo server -D 
Started building sites ... 

Built site for language en: 
0 draft content 
0 future content 
0 expired content 
1 regular pages created 
6 other pages created 
0 non-page files copied 
0 paginator pages created 
0 tags created 
0 categories created 
total in 5 ms 
Watching for changes in ~/quickstart/{data,content,layouts,static} 
Serving pages from memory 
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1) 
Press Ctrl+C to stop 

을 실행할 때 나는이, 아무 내용도 볼 수 없습니다 :

Blank screen

is 내가 할 일이있어? 빌드 또는 마크 다운 또는 렌더링 단계 또는 무엇인가?

답변

1

index.md는 필요하지 않지만 _index.md가 필요합니다. 삭제할 수 있습니다.

layouts 폴더에 index.html이라는 파일을 만듭니다. 그것이 사이트의 루트 페이지에 대한 템플릿 html 파일입니다. 이제 기본 상용구 doc/html 마크 업을 추가하십시오. 그러면 서버가 Javascript 자동 다시로드 스크립트를 삽입 할 수 있습니다. 이제 브라우저를 새로 고침하여 스크립트를 가져 오십시오.

이제 게임 할 준비가되었습니다. body 태그에 {{.Title}}을 추가하고 브라우저 업데이트를 확인하십시오.