在hugo中修改index.html

在hugo中修改index.html,go,static-site,hugo,Go,Static Site,Hugo,我刚刚开始学习雨果快速入门教程 看起来,它建议我应该能够通过创建一个_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-

我刚刚开始学习雨果快速入门教程

看起来,它建议我应该能够通过创建一个_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".
我编辑了这两篇文章,大意是:

---
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
我看到这个,没有内容:


还有什么我需要做的吗?构建、标记或渲染步骤或其他什么?

您不需要index.md,但需要index.md。你可以删除它

在layouts文件夹中创建一个名为
index.html
的文件。这是站点根页面的模板html文件。现在添加基本的样板文件doc/html标记。这允许服务器注入Javascript自动重新加载脚本。现在刷新浏览器以拾取脚本

现在你准备好比赛了。在body标签中添加{{.Title}}并观看浏览器更新

[~/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