Jekyll posts filenames without dates

孤人 提交于 2021-02-19 03:44:05

问题


I don't care about dates because I edit my previous posts all the time, so I would like to replace _posts/2015-05-05-something.md by _posts/something.md.


回答1:


Using pages doesn't require files to have dates, eg: _posts/2015-05-05-something.md becomes something.md.

(The answer came from the amazing Github support)




回答2:


To do it you need to edit _config.yml file. Variable you are interested in is permalink. Jekyll has 4 build-in styles:

date - /:categories/:year/:month/:day/:title.html
pretty - /:categories/:year/:month/:day/:title/
ordinal - /:categories/:year/:y_day/:title.html
none - /:categories/:title.html

You probably need to use none. Or you can build your own with a simple templates: more info here.



来源:https://stackoverflow.com/questions/30049870/jekyll-posts-filenames-without-dates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!