为什么hugo在错误的目录中寻找布局?

时间:2017-09-26 04:06:46

标签: hugo

在我的hugo项目中,我有文件树

  • 含量

    • NAV
      • technology.md
      • bar.md
  • 布局

    • NAV
      • single.html
      • baseof.html
      • single.html
      • baseof.html

但是当我使用详细模式运行hugo服务器时,我会收到警告

WARN: Unable to locate layout for page nav/technology.md: [technology/single.html _default/single.html theme/technology/single.html theme/_default/single.html _default/single.html]
WARN: nav/technology.html is rendered empty

为什么当页面正常工作时hugo会寻找technology/single.html而不是nav/single.html

2 个答案:

答案 0 :(得分:0)

发现原因是因为在我的markdown文件中,我使用了与内置选项type = "technology"冲突的选项type

答案 1 :(得分:0)

为了澄清您案例中的内容,'技术'不是一种类型,而是“导航”。是正确的默认类型。但是,您可以覆盖默认类型,在您的情况下,您可以使用'页面'而不是默认的' nav'。