Jekyll默认安装没有_layouts目录 [英] Jekyll default installation doesn't have _layouts directory

查看:508
本文介绍了Jekyll默认安装没有_layouts目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我通过安装并运行Jekyll来跟踪Jekyll网站上的指南(当然,我不必在此处发布)。该网站已启动并运行良好,但出于某种原因,我没有看到应该在那里的 _layouts 目录。在页面中,我可以看到它引用了一些布局,例如:
$ b

index.html

  --- 
布局:默认
---

< div class =home>

about.md

  --- 
布局:页面
标题:关于
永久链接:/ about /
---

这是Jekyll的主题。

但是当您查看项目的目录结构时:



没有布局文件夹..这是怎么回事?一切工作虽然。在本地主机上运行时,它看起来非常好。

解决方案

您必须运行最近的Jekyll 3.2版本,它引入了基于Gem的主题(来自 https://jekyllrb.com/docs/themes/ ):


Jekyll以包含网站内容的方式覆盖版面,包含和样式表。


主题设置在_config.yml中:

 主题:最小值
_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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆