Browse Source

Fix CI error (4)

master
Vladimir Hodakov 1 year ago
parent
commit
003de0bbb1
Signed by: Vladimir Hodakov <vladimir@hodakov.me> GPG Key ID: 673980B6882F82C6
2 changed files with 16 additions and 3 deletions
  1. +2
    -2
      .gitlab-ci.yml
  2. +14
    -1
      _plugins/2-generate_reviews.rb

+ 2
- 2
.gitlab-ci.yml View File

@@ -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

+ 14
- 1
_plugins/2-generate_reviews.rb View File

@@ -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)

Loading…
Cancel
Save