diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2c0cf1b..9206ca3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,8 +12,8 @@ before_script: build site: stage: build script: - - bundle exec jekyll build -d public + - bundle exec jekyll build -d lorchess.ru artifacts: expire_in: 1 month paths: - - public + - lorchess.ru diff --git a/_plugins/2-generate_reviews.rb b/_plugins/2-generate_reviews.rb index df19d7e..1b73d0d 100644 --- a/_plugins/2-generate_reviews.rb +++ b/_plugins/2-generate_reviews.rb @@ -4,7 +4,20 @@ module Jekyll safe true priority :low - include I18nFilter + LOCALE = :ru + + def localize(input, format=nil) + load_translations + format = (format =~ /^:(\w+)/) ? $1.to_sym : format + I18n.l input, :format => format + end + + def load_translations + unless I18n::backend.instance_variable_get(:@translations) + I18n.backend.load_translations Dir[File.join(File.dirname(__FILE__), '../_locales/*.yml')] + I18n.locale = LOCALE + end + end # Generates the reviews file def generate(site)