Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
允许jekyll帖子没有日期,只有年份和月份_Jekyll - Fatal编程技术网

允许jekyll帖子没有日期,只有年份和月份

允许jekyll帖子没有日期,只有年份和月份,jekyll,Jekyll,有时,我会启动一些项目,需要一个月的工作时间,但它们在一个月内启动,并且没有与之相关的具体日期。我想保存一个类似于2011-05-00noday.md的帖子,但杰基尔不允许这样做。有没有办法做到这一点,让permalink反映/2011/05/noday.html?我觉得这应该是页面而不是帖子。您可以有一个名为/projects/的根级文件夹,然后在其中包含每个项目的单独文件或每个项目的子目录,其中包含index.md文件 如果您不喜欢这个想法,可以在post的YAML Front Matter

有时,我会启动一些项目,需要一个月的工作时间,但它们在一个月内启动,并且没有与之相关的具体日期。我想保存一个类似于
2011-05-00noday.md
的帖子,但杰基尔不允许这样做。有没有办法做到这一点,让permalink反映
/2011/05/noday.html

我觉得这应该是
页面
而不是
帖子
。您可以有一个名为
/projects/
的根级文件夹,然后在其中包含每个项目的单独文件或每个项目的子目录,其中包含
index.md
文件

如果您不喜欢这个想法,可以在
post
YAML 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)
---
查看他们在此Jekyll站点中执行项目的方式:
我觉得这应该是一个
页面
而不是
帖子
。您可以有一个名为
/projects/
的根级文件夹,然后在其中包含每个项目的单独文件或每个项目的子目录,其中包含
index.md
文件

如果您不喜欢这个想法,可以在
post
YAML 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)
---
查看他们在此Jekyll站点中执行项目的方式:
检查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

检查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

ymlfm变量:year:month和:title不起作用它将永久链接设置为literal
http://localhost:1111/:year/:month/:title.html
@ThomasReggi,是的,这些占位符可以替换为文字日期。我将用注释更新它。ymlfm变量:year:month和:title不起作用。它将永久链接设置为literal
http://localhost:1111/:year/:month/:title.html
@ThomasReggi,是的,这些占位符可以替换为文字日期。我会用便条更新。