2017-10-14 20 views
0

私はちょうどhugoクイックスタートチュートリアルを開始しています。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が必要です。あなたはそれを削除することができます。

レイアウトフォルダにindex.htmlという名前のファイルを作成します。これは、サイトのルートページのテンプレートHTMLファイルです。今すぐあなたの基本的な定型文doc/htmlのマークアップを追加してください。これにより、サーバーはJavascriptの自動リロードスクリプトを挿入できます。ブラウザをリフレッシュしてスクリプトを取得します。

今すぐプレイする準備ができました。 bodyタグのadd {{.Title}}で、ブラウザのアップデートを見てください。

関連する問題