Hugo静态生成器网站上未触发过的单页模板

时间:2020-11-09 17:53:49

标签: html web hugo static-generator

我在触发帖子上触发自定义单个页面时遇到问题。 内容的组织方式如下:

enter image description here 将我所有的帖子都放到posts文件夹中(我不使用_index.md,因为该文件夹比/ content落后一步,并且被视为Hugo的Section)

我的布局看起来像这样(我没有使用主题):

enter image description here

但是,当我单击指向/ posts / post-name / post / URL的帖子之一时,它将呈现layout / default / single.html模板。因为我看到Hugo's Lookup Order说的是layout / default / single.html的优先级低于layout / section / single.html,所以我真的在问自己。此外,当我删除default / single.html时,出现错误,提示未实现任何“类型”“页面”。因此,我假设我在体系结构上弄错了。然后我看到this page的官方文档使用的结构与我的完全相同。我需要您的帮助以找出文件夹中的问题,如果需要,我可以提供更多详细信息。预先感谢。

0 个答案:

没有答案