雨果网站不在本地启动

时间:2019-06-16 21:24:30

标签: github-pages hugo

我目前正在尝试在本地建立一个Hugo网站,但没有内容显示。我希望有更多的故障排除步骤或任何可以帮助我进行彻底重建的事情,这样我就不必将我的所有帖子都转移到Google网站上。

我尝试重新实例化该站点,使用hugo重建该站点,并使用hugo serverhugo server -D启动服务器,但是我只得到了一个空白屏幕。

我的页面不是草稿,所以肯定会显示一些东西。公用文件夹或索引文件夹可能已损坏,但我不确定。

hugo versionHugo Static Site Generator v0.48/extended darwin/amd64

go versiongo 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给我一个空白屏幕。

1 个答案:

答案 0 :(得分:1)

第一个hugo -v --debug -D可以告诉您更多信息

第二,要确保确实生成了某些内容,请尝试:

hugo server --renderToDisk --gc --cleanDestinationDir

检查文件是否已创建(而不是在内存中提供)

注意:我总是喜欢添加config.toml

builddrafts = true 

启动项目时确保确定生成了所有内容。

OP ladygremlin确认in the comments

  

我认为builddrafts = true中的config.toml已将其修复!
  我还升级到了最新版本的hugo。

相关问题