I’m building a multilingual website with Jekyll. Since the content is multilingual, tags will be too.
Below is my current configuration, which puts tags in all languages into a single-language layout.
I would love to know if there’s a way to make multiple tag layouts in different languages and apply them according to the language of the posts in which the tags are listed. For example, posts in /en-uk/ directory should have their tags in an tags-en.html layout and posts in /zh-cn/ directory should have their tags in an tags-zh.html layout.
On an English tag page, all posts listed there should be from the English site and on a Chinese tag page, all posts listed there should be from the Chinese site.
Right now this configuration also have a single directory for all tags, so the output would be subject/tag. I would also like to know if there’s a way to set multiple directories based on language as well. For example, English tags are listed at /en-uk/subject/tag and Chinese tags are listed at /zh-cn/subject/tag.
gems:
- jekyll-paginate-v2
- jekyll-tagging
- jekyll-paginate-tags
tag_page_layout: tags
tag_page_dir: '/subject'
tag_permalink_style: pretty