注意:我可能已经遇到了在Linux for Windows 10环境中运行的Jekyll的边缘情况。纯Windows或纯Linux上使用的相同数据按预期工作(在@marcanuy的答案之后进行修改之后)。经过更多测试后我会回来。
我通过
创建了一个新网站class Pulse extends React.Component {
render() {
return (
<Star style={{top: {this.props.top} + 'em'}}></Star>
);
}
}
export default Pulse;
这在jekyll new myblog --blank
中创建了预期的结构。我添加了一个模板myblog
_layouts/docs.html
然后我创建了一个<h1>hello world</h1>
{{ content }}
文件:
_posts/hello.md
运行后
---
title = the hello world page
layout = docs
---
# this is a hello world page
Hello world everyone
我的# jekyll build
Configuration file: none
Source: /root/myblog
Destination: /root/myblog/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.03 seconds.
Auto-regeneration: disabled. Use --watch to enable.
文件夹为空,除了从我的博客根目录复制的_site
文件(逐字复制 - 这是我在根目录中放入index.html
的内容)< / p>
为什么没有index.html
生成?我希望它包含
hello.html
答案 0 :(得分:1)
有两个问题让jekyll没有建立“你好”页面:
hello.md
放在_posts
文件夹中,那么正确的文件名应包含帖子的日期,如:2017-05-21-hello.md
然后它将可用:
.
├── _drafts
├── index.html
├── _layouts
│ └── docs.html
├── _posts
│ └── 2017-05-21-hello.md
└── _site
├── hello.html
└── index.html
另一种方法是将其发布为page
:
在/hello.md
中,即:在根级别(不在/_posts
内)
.
├── _drafts
├── hello.md
├── index.html
├── _layouts
│ └── docs.html
├── _posts
└── _site
├── hello.html
└── index.html
另一个问题是hello.md
的前端问题的语法,每个属性应使用:
而不是=
来定义:
---
title: the hello world page
layout: docs
---
# this is a hello world page
Hello world everyone