M
M
midzurana2021-02-18 12:34:33
ruby
midzurana, 2021-02-18 12:34:33

How to add a new locale to Jekyll?

The project uses the jekyll-multiple-languages-plugin. I have a russian locale (default is example.com ) and an english one that opens at example.com/en . At the same time, example.com/ru gives a 404 error.
I followed the plugin documentation to add a new locale but didn't work: https://github.com/kurtsson/jekyll-multiple-langua...
This is what my _config.yml looks like:

title: example
description: >- # this means to ignore newlines until "baseurl:"
  
baseurl: "" # the subpath of your site, e.g. /blog
url: "https://example.by" # the base hostname & protocol for your site, e.g. http://example.com

# Build settings
markdown: kramdown
theme: minima
plugins:
  - jekyll-feed
  - jekyll-multiple-languages-plugin
  - jekyll-sitemap

sass:
  style: compressed

permalink: /blog/:slug/

languages: ["ru", "en"]
exclude_from_localizations: ["javascript", "images", "css", "scripts", "favicons.ico"]


And the nesting of locales:602e349c73e2d864191260.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
midzurana, 2021-02-18
@midzurana

The thing turned out to be that this plugin does not create a separate locale for the default language (the default language in languages ​​is indicated first, and in my case it is Russian).
If creating a separate locale is important, then the answers are here https://github.com/kurtsson/jekyll-multiple-langua...
The easiest way is to create 2 identical Russian locales, one of which will open on the main page, and the second when redirect to /ru

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question