Multi-languages plugin
Let’s see how to install and configure multi-languages plugin to make jekyll support multi-languages. There are many plugins for multi-languages but we introduce jekyll-polyglot at here.
If you wanna know other multi-languages plugin, see awesome-jekyll-plugins.
Install the plugin
- execute below command on console for installing the plugin.
gem install jekyll-polyglot
- configure below options on
_config.ymlfile.
plugins:
- jekyll-polyglot
Plugin global settings
configure below options on _config.yml file.
languages: ['ja', 'ko', 'en']
default_lang: 'ja'
exclude_from_localization: ['javascript', 'images', 'css']
parallel_localization: false
- languages: these are multi-languages list which support on the site.
- default_lang: Default languages in supported multi-languages.
- exclude_from_localization: excluded folder list which you don’t want to localize.
- parallel_localization: when this is set true, jekyll will compile parallel using fork(). Windows OS doesn’t support fork() so must set false.
Page settings
- Try to make below folder structure under the
_postsfolder.
|-- _posts
| |-- 2018-09-19-multi-languages-plugin
| | |-- common
| | | |-- folder_structure.md
| | |-- 2018-09-19-multi-languages-plugin-en.md
| | |-- 2018-09-19-multi-languages-plugin-ja.md
| | |-- 2018-09-19-multi-languages-plugin-ko.md
- 2018-09-19-multi-languages-plugin: make the folder which is set same post name under the
_postsfolder for management. - common: save common files which multi-languages file use. For example, the directory structure which you see now on, write to
folder_structure.mdand use{% include_relative common/folder_structure.md %}on multi-languages files for displaying it. - 2018-09-19-multi-languages-plugin-[language].md: make each multi-languages pages per
languagesconfigurations in_config.yml. - set specific page language at the top of each language pages.
---
layout: 'post'
lang: 'en'
...
---
Check it out
We finished to set every configurations. Let’s check each page languages.
- You can access pages created by plugins via below URL.
http://site_url/jekyll/multi-languages-plugin/
http://site_url/ko/jekyll/multi-languages-plugin/
http://site_url/en/jekyll/multi-languages-plugin/
- The page which is set
default_langin_config.ymlfile can be accessed directly byhttp://site_url/path. - The other pages except
default_langcan be accessed byhttp://site_url/[language]/path. - You can see multi-languages folders in
_sitefolder after executing jekyll test server or building the site.- Execute jekyll test server:
bundle exec jekyll serve - Build jekyll site:
bundle exec jekyll build
- Execute jekyll test server:
Was my blog helpful? Please leave a comment at the bottom. it will be a great help to me!
App promotion
You can use the applications that are created by this blog writer
If you have interested, please try to download them for free.
Deku.Deku created the applications with Flutter.If you have interested, please try to download them for free.



