From 6be4bdf6ad92eea3e57ccfaf95672daf43cc1090 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 6 Jul 2021 08:46:18 +0200 Subject: ci: fixed a lot of issues with style and urls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- _plugins/log.rb | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) (limited to '_plugins/log.rb') diff --git a/_plugins/log.rb b/_plugins/log.rb index 203f583..436b902 100644 --- a/_plugins/log.rb +++ b/_plugins/log.rb @@ -15,8 +15,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -require "date" -require_relative "modified_time_helper" +require 'date' +require_relative 'modified_time_helper' module Jekyll # Render the last modification time of the given page. @@ -24,10 +24,10 @@ module Jekyll include ::Jekyll::ModifiedTimeHelper def render(context) - time = Time.iso8601(modified_time(context["page"])) + time = Time.iso8601(modified_time(context['page'])) - if context["page"]["lang"] == "en" - time.strftime("%B %-d, %Y, at %H:%m") + if context['page']['lang'] == 'en' + time.strftime('%B %-d, %Y, at %H:%m') else time.strftime("%-d de #{catalan_month(time.month)} de %Y, a les %H:%m") end @@ -40,31 +40,31 @@ module Jekyll def catalan_month(month) case month when 1 - "gener" + 'gener' when 2 - "febrer" + 'febrer' when 3 - "març" + 'març' when 4 - "abril" + 'abril' when 5 - "maig" + 'maig' when 6 - "juny" + 'juny' when 7 - "juliol" + 'juliol' when 8 - "agost" + 'agost' when 9 - "setembre" + 'setembre' when 10 - "octubre" + 'octubre' when 11 - "novembre" + 'novembre' when 12 - "desembre" + 'desembre' else - "" + '' end end # rubocop:enable Metrics/MethodLength, Metrics/CyclomaticComplexity @@ -74,14 +74,15 @@ module Jekyll class RenderLogLink < Liquid::Tag include ::Jekyll::ModifiedTimeHelper - WEBSITE_BASE = "http://git.mssola.com" - WEBSITE_REPO = "jo.git" + WEBSITE_BASE = 'https://github.com' + WEBSITE_REPO = 'mssola/jo.mssola.com' + WEBSITE_BRANCH = 'main' def render(context) - page = context["page"] - url = "#{WEBSITE_BASE}/#{WEBSITE_REPO}/log/#{page["relative_path"]}" + page = context['page'] + url = "#{WEBSITE_BASE}/#{WEBSITE_REPO}/commits/#{WEBSITE_BRANCH}/#{page['relative_path']}" - if page["lang"] == "en" + if page['lang'] == 'en' "here" else "aquí" @@ -90,5 +91,5 @@ module Jekyll end end -Liquid::Template.register_tag("render_modified_at", Jekyll::RenderModifiedAt) -Liquid::Template.register_tag("render_log_link", Jekyll::RenderLogLink) +Liquid::Template.register_tag('render_modified_at', Jekyll::RenderModifiedAt) +Liquid::Template.register_tag('render_log_link', Jekyll::RenderLogLink) -- cgit v1.2.3