Setting permalink options for each directory in jekyll

Is it possible to have different permalink settings for different directories?

For example, if I have a Jekyll installation where blog entries are written to /blog/_posts/and news items in /news/_posts, then by default each entry will have permalinks in the /blog/2011/06/24/slug.htmland format /news/2011/06/24/slug.html.

The permalink for blog entries is fine, but I need to change the format of permalinks to news for something else, for example /news/2011/slug.

I tried changing the parameters permalinkin the YAML control for the layout used in the news item, however this will not work as the permalink parameters in the front YAML array are not interpolated ( as was confirmed in the answer to this question ).

Is there a mechanism for setting specific parameters in _config.yaml? Or is it better to achieve these results?

+5
source share
3 answers

The only way to achieve this is by having two different instances of jekyll.

() "" "_config.yaml". "" , "../_ /".

, Jekyll ; script (.. Rakefile) jekylls (, ).

, , 1 .

+1

, - , , / /articles/ 2013/.. /work/2013/..

, , :

permalink: /:categories/:year/:title

"" "" , .

+2

Just inspired by the comment. Why not do it:

permalink: /:categories/:title

and then in the forefront for your blog just

categories: blog 2013 05 01

news only

categories: news 2013
+2
source

All Articles