Jekyll默认安装没有_layouts目录 [英] Jekyll default installation doesn't have _layouts directory
问题描述
_layouts
目录。在页面中,我可以看到它引用了一些布局,例如:$ b
index.html
---
布局:默认
---
< div class =home>
about.md
---
布局:页面
标题:关于
永久链接:/ about /
---
这是Jekyll的主题。
但是当您查看项目的目录结构时:
没有布局文件夹..这是怎么回事?一切工作虽然。在本地主机上运行时,它看起来非常好。
您必须运行最近的Jekyll 3.2版本,它引入了基于Gem的主题(来自 https://jekyllrb.com/docs/themes/ ):
Jekyll以包含网站内容的方式覆盖版面,包含和样式表。
主题设置在_config.yml中:
主题:最小值
$ c $以前在 _layouts
, _includes 中的初始文件
和 _sass
现在与主题打包在一起。
So I followed the guide on the Jekyll website by installing and running Jekyll (sure I don't have to post this here). And the site is up and running perfectly but for some reason I don't see the _layouts
directory that's supposed to be there. In the pages I can see that it references some layouts i.e:
index.html
---
layout: default
---
<div class="home">
about.md
---
layout: page
title: About
permalink: /about/
---
This is the base Jekyll theme.
But when you look at the directory stucture of the project:
No layouts folder.. what's up with that? Everything works though. And it looks perfectly fine when run on localhost.
解决方案 You must be running the recent Jekyll version 3.2, which introduces Gem based themes (from https://jekyllrb.com/docs/themes/):
Jekyll themes package layouts, includes, and stylesheets in a way that can be overridden by your site’s content.
The theme is set in _config.yml:
theme: minima
Initial files that were previously in _layouts
, _includes
, and _sass
are now packaged with the theme.
这篇关于Jekyll默认安装没有_layouts目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!