我想用Jekyll来创建一个网站.不是博客.有没有办法避免在url和页面文件名中指定创建日期?
我认为Jekyll背后的 idea 非常棒,但它似乎与博客生成内容联系太紧密,而它在更一般的用例中也可能有用.
我想用Jekyll来创建一个网站.不是博客.有没有办法避免在url和页面文件名中指定创建日期?
我认为Jekyll背后的 idea 非常棒,但它似乎与博客生成内容联系太紧密,而它在更一般的用例中也可能有用.
What the docs say:
您可以在_config中配置永久链接.yml文件如下:
permalink: /:categories/:year/:month/:day/:title.html
如果不指定任何permalink设置,Jekyll将使用上述模式作为默认模式.也可以使用内置的永久链接样式设置永久链接:
permalink: date
尽管可以使用模板变量指定自定义permalink模式,但为了方便起见,Jekyll还提供了以下内置样式.
- 日期=/:类别/:年/:月/:日/:标题.html
- 漂亮=/:类别/:年/:月/:日/:标题/
- 序号=/:类别/:年份/:y_日/:标题.html
- 无=/:类别/:标题.html
资料来源:https://jekyllrb.com/docs/permalinks/
This is the basic setting I use:
permalink: pretty
这将页面设置为漂亮的permalink样式.因此,'/联系.md'将变成'/contact/'.
How I use it for blog posts:
permalink: /blog/:title/
这将确保路径包含(sluggified)标题.
How I use it for collections:
permalink: /desiredpath/:name/
这将确保路径包含文件名.