在本地Hugo项目中为内容文件定义自定义模板

问题描述 投票:0回答:1

在本地运行雨果。请参阅我的目录结构的附件照片。

在Chrome浏览器中点击localhost:1313/directions-accomodations。内容文件(红色框)正在加载single.html模板(蓝色框)。

我希望它加载自定义模板。 directions.html其中的任何一个)。我需要将directions.html放在哪里,或者,为了实现这一点,我应该在layout中为/directions-accomodations/index.md的前值赋予哪个值?

enter image description here

非常感谢!

hugo
1个回答
0
投票

您可以将布局提及为布局:“方向住宿/路线”

这将使布局指向directions.html

© www.soinside.com 2019 - 2024. All rights reserved.