Based on deleted https://github.com/gacha/gacha.id.lv/blob/master/_plugins/i18n_filter.rb
- Add
jekyll-i18n-date
to_plugins
folder of your site. - Create folder
_locales
and put some locale files from https://github.com/svenfuchs/rails-i18n/tree/master/rails/locale there. - Add lang variables to
_config.yaml
or to frontmatter of any page/post like this:
lang: de
- Localize your Date/DateTime/Time variables with
{{ page.date | localize: "%d.%m.%Y" }}
or
{{ post.date | localize: "%d.%m.%Y", "es" }}
- Lang parameter in liquid
- Page
- Site
If no locale file for language parameter is found in _locales
or date is nil, default date format is displayed.
If "date" happens to be an integer value, it is converted with Time.at()
(this rather suprising behaviour should probably be changed)