所以我按照 Jekyll 网站上的指南安装和运行 Jekyll(当然我不必在此处发布)。该站点已正常启动并运行,但由于某种原因,我没有看到本应存在的 _layouts
目录。在页面中,我可以看到它引用了一些布局,即:
index.html
---
layout: default
---
<div class="home">
about.md
---
layout: page
title: About
permalink: /about/
---
This is the base Jekyll theme.
但是当你查看项目的目录结构时:
没有布局文件夹..那是怎么回事?不过一切正常。在本地主机上运行时看起来非常好。
最佳答案
您必须运行最新的 Jekyll 版本 3.2,它引入了基于 Gem 的主题(来自 https://jekyllrb.com/docs/themes/):
Jekyll themes package layouts, includes, and stylesheets in a way that can be overridden by your site’s content.
主题在_config.yml中设置:
theme: minima
以前在 _layouts
、_includes
和 _sass
中的初始文件现在与主题打包在一起。
关于html - Jekyll 默认安装没有 _layouts 目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38891463/