html - 在内容存储库hugo中添加html文件并将其链接到scss
问题描述
这是我的雨果网站的树:
.
├── archetypes
├── assets
├── config.toml
├── content
├── layouts
├── Makefile
├── node_modules
├── package.json
├── public
├── README.md
├── resources
├── static
└── www.deploy
我想知道是否可以在存储库/content中添加/page2/index.html,所以有/content/page2/index.html。通常存储库/内容中只有降价文件。我很确定这在某种程度上是可能的。
如果 /content 中可能有一个 html 文件,我如何将它链接到一个 scss 文件?scss 文件将存储在存储库 /assets/scss/pages2/pages.scss 中。
如果无法在 /content 中添加 html 文件,那么如何在 hugo 中添加新页面?在 /layout 文件夹中添加一个 html 文件: /layout/page2/index.html 链接到 /content/page2/index.md?
我很困扰。
解决方案
里面的文件content/
是源文件:用markdown、org-mode等编写的文件,会被站点渲染成html。所以这不是放置 html 文件的地方。
从您的问题下方的评论中,听起来您想要实现的是创建一个与您的网站通常呈现的页面不同的页面。
解决这个问题的方法是编辑布局。我需要有关您网站的更多信息才能回答具体信息。但事情最终会看起来像这样:
content/
dir1/
file1.md
file2.md
...
dir2/
that-very-different-file.md
在布局中,您必须为外观截然不同的页面创建新布局。所以你的布局目录看起来像这样:
layouts/
dir1/
single.html
dir2/
single.html
中的single.html
文件dir1
包含常规文件的模板布局和single.html
非常dir2
不同页面的模板中的文件。
推荐阅读
- angular - 单击按钮将 mat-slider 的值更改为默认值
- php - 如何使文件只能由 PHP 访问?
- reactjs - 如何在 React 中使用 onClick 保存和删除 useState 中的值?
- c++ - 柯南...[关闭]
- javascript - 如何根据键入到输入字段(例如搜索栏)中的值来更改 HTML 中 div 元素的可见性?
- css - 如何通过另一个类扩展链中的顶级选择器
- kubernetes - 错误:(gcloud.beta.filestore.instances.create)解析错误 [instance]
- css - scss自定义mixin覆盖更改值不替换,但添加它
- flutter - Flutter 相当于 Xamarin Forms Element AutomationID
- typescript - 方法的单独公共/私人签名