Jekyll 默认安装没有 _layouts 目录
Jekyll default installation doesn't have _layouts directory
所以我按照 Jekyll 网站上的指南安装和 运行ning Jekyll(当然我不必在此处 post 这样做)。该网站已经正常运行 运行ning,但由于某种原因,我没有看到应该存在的 _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
中的初始文件现在与主题一起打包。
基本上 Jekyll 希望您使用主题,所以您再也看不到 _layouts
、_includes
、_sass
、_assets
。
要使用以前的行为,只需从 gemfile 中复制:
open $(bundle show minima)
将这 4 个文件夹复制到您的 jekyll 目录中
如果你想要包含所有 4 个文件夹的旧式 Jekyll 网站目录,那么你可以使用此命令:
jekyll new my-new-website-name --blank
我在创建个人网站时也做过同样的事情。
所以我按照 Jekyll 网站上的指南安装和 运行ning Jekyll(当然我不必在此处 post 这样做)。该网站已经正常运行 运行ning,但由于某种原因,我没有看到应该存在的 _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
中的初始文件现在与主题一起打包。
基本上 Jekyll 希望您使用主题,所以您再也看不到 _layouts
、_includes
、_sass
、_assets
。
要使用以前的行为,只需从 gemfile 中复制:
open $(bundle show minima)
将这 4 个文件夹复制到您的 jekyll 目录中
如果你想要包含所有 4 个文件夹的旧式 Jekyll 网站目录,那么你可以使用此命令:
jekyll new my-new-website-name --blank
我在创建个人网站时也做过同样的事情。