reuixiy / hugo-theme-meme

😝 You can’t spell awesome without MemE!
https://io-oi.me/hugo-theme-meme
MIT License
1.01k stars 279 forks source link

我在运行`hugo server`时出现了error。 #37

Closed fakerpawnno1 closed 4 years ago

fakerpawnno1 commented 4 years ago

下面是错误信息: Error: Error building site: failed to render pages: render of "section" failed: execute of template failed: template: section\categories.html:2:7: executing "main" at <partial "tree/sections.html" .>: error calling partial: "D:\Hugo\Sites\Blog\themes\meme\layouts\partials\tree\sections.html:25:79": execute of template failed: template: partials/tree/sections.html:25:79: executing "partials/tree/sections.html" at <len $pages>: error calling len: len of untyped nil

reuixiy commented 4 years ago

你新建文章了没?

fakerpawnno1 commented 4 years ago

新建文章了,我使用hugo server --disableFastRender 就会出这个问题,使用hugo命令也是。

reuixiy commented 4 years ago

贴一下你的 content 文件夹的目录结构(以下命令不确定是否正确)

> tree /F

造成这个问题的原因应该是你有分区下没有文章。

fakerpawnno1 commented 4 years ago

image

reuixiy commented 4 years ago

奇怪了,我这并没有任何问题

2019-12-16-20-34-16

请再贴一下你 config.toml 中的 mainSections 一行的内容,以及 hugo version 命令的输出。

fakerpawnno1 commented 4 years ago

image

image

reuixiy commented 4 years ago

那真是奇怪了……因为我这 Linux 下是没有任何问题的……要不你去下载个最新版的 Hugo 试试?或者再自行排除测试下?要是还不行,只有暂时将 config.toml 中的 displayPostsCount 设置为 false……

reuixiy commented 4 years ago

还有一点,你新建的 Markdown 文件的 Front Matter 中有 draft: true 吗?如果有,请将它设置为 false 或直接删除,或者在命令后方加上 -D 参数以渲染草稿,比如 hugo server -Dhugo -D

fakerpawnno1 commented 4 years ago

我知道为什么了,我忘记了注释draft了,渲染时忘了加参数。刚才突然想起来了。