2013-05-21 58 views
0

有时我有项目,我启动,它需要一个月的工作,他们在一个月内推出,他们没有具体的日期与他们关联。我想保存一个类似2011-05-00noday.md的帖子,但jekyll不会允许它。有没有办法做到这一点,并永久链接反映/2011/05/noday.html允许一个jekyll发布没有每天只有年和月

回答

1

检查此设置YAML配置文件:

#for all pages 
permalink: pretty 

#for posts 
defaults: 
    - scope: 
    path: "" 
    type: "posts" 
    values: 
#this looks prettier 
    permalink: /blog/:title 
#for your needs 
    permalink: /:year/:month/:title 
1

这听起来对我来说应该是page而不是post。您可以拥有一个名为/projects/的根级文件夹,然后在其中有每个项目的单个文件或每个项目的子目录,其中包含index.md文件。

如果你不喜欢这个主意,你可以在postYAML Front Matter设置permalink,这将覆盖从_config.yml设置:

--- 
layout: post 
permalink: /projects/project_name/ 
--- 

,或者如果你想在那里的日期而不想所有您的永久链接可以这样设置:

--- 
layout: post 
permalink: /:year/:month/:title.html 
(replace with actual year, month and title, e.g., /2013/06/my-title.html) 
--- 

看看他们做的项目在此杰基尔网站的方式: https://github.com/flatterline/flatterline.com/tree/master/_projects

+0

为ymlfm变量:年:月和:标题不能工作,设置固定链接字面'HTTP://本地主机:1111/:年/月/:title.html'。 – ThomasReggi

+0

@ThomasReggi,是的,这些是占位符,你可以用字面日期替换。我会用笔记更新它。 –

相关问题