Hugo 站点未在本地启动
Hugo site isn't starting locally
我目前正在尝试在本地建立一个 Hugo 站点,但没有显示任何内容。我喜欢更多的故障排除步骤或任何可以帮助我进行干净重建的东西,这样我就不必将我所有的帖子都转移到 Google 站点。
我试过重新实例化站点,用 hugo
重建它,用 hugo server
和 hugo server -D
启动服务器,但我只得到一个空白屏幕。
我有一些不是草稿的页面,所以一定要显示一些内容。 public 或索引文件夹有可能被搞砸了,但我不确定。
hugo version
: Hugo Static Site Generator v0.48/extended darwin/amd64
go version
: go version go1.11.2 darwin/amd64
config.toml
:
baseURL = ""
languageCode = "en-us"
title = ""
theme = "ananke"
[menu]
[[menu.main]]
identifier = "Posts"
name = "Posts"
pre = "<i class='fa fa-road'></i>"
url = "/posts/"
weight = -100
[params]
featured_image = "images/space-cat-wallpaper.jpg"
twitter = ""
使用 hugo
构建页面时:
| EN
+------------------+----+
Pages | 72
Paginator pages | 0
Non-page files | 0
Static files | 21
Processed images | 0
Aliases | 1
Sitemaps | 1
Cleaned | 0
Total in 88 ms
使用hugo server -D
启动本地实例时:
| EN
+------------------+-----+
Pages | 117
Paginator pages | 5
Non-page files | 0
Static files | 21
Processed images | 0
Aliases | 1
Sitemaps | 1
Cleaned | 0
Total in 120 ms
Watching for changes in /Users/jschalz/Desktop/hugo-jschalz.github.io-2/{content,data,layouts,static,themes}
Watching for config changes in /Users/jschalz/Desktop/hugo-jschalz.github.io-2/config.toml
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
在 运行 hugo -v --debug -D
之后,我收到以下警告,然后是很多调试噪音:
WARN 2019/06/16 16:33:21 No translation bundle found for default language "en"
WARN 2019/06/16 16:33:21 Translation func for language en not found, use default.
WARN 2019/06/16 16:33:21 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
导航到 localhost:1313 时出现空白屏幕。
第一个hugo -v --debug -D
可以告诉你更多
其次,要真正确定生成了一些东西,请尝试:
hugo server --renderToDisk --gc --cleanDestinationDir
检查文件是否已创建(而不是在内存中提供)
注意:我总是喜欢添加 config.toml
builddrafts = true
启动项目时很有用,可确保生成所有内容。
OP ladygremlin confirms :
I think the builddrafts = true
in the config.toml
fixed it!
I also upgraded to the newest version of hugo.
我目前正在尝试在本地建立一个 Hugo 站点,但没有显示任何内容。我喜欢更多的故障排除步骤或任何可以帮助我进行干净重建的东西,这样我就不必将我所有的帖子都转移到 Google 站点。
我试过重新实例化站点,用 hugo
重建它,用 hugo server
和 hugo server -D
启动服务器,但我只得到一个空白屏幕。
我有一些不是草稿的页面,所以一定要显示一些内容。 public 或索引文件夹有可能被搞砸了,但我不确定。
hugo version
: Hugo Static Site Generator v0.48/extended darwin/amd64
go version
: go version go1.11.2 darwin/amd64
config.toml
:
baseURL = ""
languageCode = "en-us"
title = ""
theme = "ananke"
[menu]
[[menu.main]]
identifier = "Posts"
name = "Posts"
pre = "<i class='fa fa-road'></i>"
url = "/posts/"
weight = -100
[params]
featured_image = "images/space-cat-wallpaper.jpg"
twitter = ""
使用 hugo
构建页面时:
| EN
+------------------+----+
Pages | 72
Paginator pages | 0
Non-page files | 0
Static files | 21
Processed images | 0
Aliases | 1
Sitemaps | 1
Cleaned | 0
Total in 88 ms
使用hugo server -D
启动本地实例时:
| EN
+------------------+-----+
Pages | 117
Paginator pages | 5
Non-page files | 0
Static files | 21
Processed images | 0
Aliases | 1
Sitemaps | 1
Cleaned | 0
Total in 120 ms
Watching for changes in /Users/jschalz/Desktop/hugo-jschalz.github.io-2/{content,data,layouts,static,themes}
Watching for config changes in /Users/jschalz/Desktop/hugo-jschalz.github.io-2/config.toml
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
在 运行 hugo -v --debug -D
之后,我收到以下警告,然后是很多调试噪音:
WARN 2019/06/16 16:33:21 No translation bundle found for default language "en"
WARN 2019/06/16 16:33:21 Translation func for language en not found, use default.
WARN 2019/06/16 16:33:21 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
导航到 localhost:1313 时出现空白屏幕。
第一个hugo -v --debug -D
可以告诉你更多
其次,要真正确定生成了一些东西,请尝试:
hugo server --renderToDisk --gc --cleanDestinationDir
检查文件是否已创建(而不是在内存中提供)
注意:我总是喜欢添加 config.toml
builddrafts = true
启动项目时很有用,可确保生成所有内容。
OP ladygremlin confirms
I think the
builddrafts = true
in theconfig.toml
fixed it!
I also upgraded to the newest version of hugo.