From df474233a8776cb318baccfe853e573640b3fd58 Mon Sep 17 00:00:00 2001 From: el00ruobuob Date: Thu, 14 Feb 2019 15:22:35 +0100 Subject: [PATCH] Moneropedia ruby script tweak for 5 letter country code (ie. pt-br) --- _plugins/moneropedia.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/_plugins/moneropedia.rb b/_plugins/moneropedia.rb index b5b00c6b..87567a02 100644 --- a/_plugins/moneropedia.rb +++ b/_plugins/moneropedia.rb @@ -81,8 +81,13 @@ module Jekyll # Getting language from tag, and cleaning it if content.include? '@lang_tag_' - lang = content[/\@lang_tag_\w{2}/][-2, 2].downcase - content = content.gsub(/(\@lang_tag_\w{2}\n)/i, "") + if ( content =~ /\@lang_tag_\w{2}-\w{2}/ ) + lang = content[/\@lang_tag_\w{2}-\w{2}/][-5, 5].downcase; + content = content.gsub(/(\@lang_tag_\w{2}-\w{2}\n)/i, "") + else + lang = content[/\@lang_tag_\w{2}/][-2, 2].downcase; + content = content.gsub(/(\@lang_tag_\w{2}\n)/i, "") + end # Jekyll.logger.warn YAML::dump(@@moneropedia_ordered) if content.include? '@moneropedia_index'