Multiple tag layouts for multilingual websites

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

I’m sorry my English is very bad, and I don’t know the Chinese language too; I will try to learn and try to help you later when I can master myself. So sorry.

I usually listen to Chinese music, and I love it, even I can’t understand what they sing about!!

All I can do is try to copy the Chinese word and paste it to YouTube and search for luck.

Will you be able to use the jekyll-tagging plugin with Gitub-Pages? I believe only a small set of plugins are supported: About GitHub Pages and Jekyll - GitHub Docs

@chuckhoupt I’m not sure. It’s fine to use plugins that GitHub Pages doesn’t support. I’ve been building the site locally and pushing the _site folder to GitHub repository. I’m not sure whether the jekyll-tagging plugin can achieve this though.

@lizhaozhi Great, you’re only using Github Pages for web hosting (not building the site), so you can use custom plugins.

It doesn’t look like jekyll-tagging has any multilingual support. Some options:

  • Look for a alternative or fork jekyll-tagging to add multilingual support
  • Implement similar functionality directly in Jekyll via Liquid.