aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.rubocop.yml4
-rw-r--r--_plugins/twitter.rb2
-rw-r--r--_plugins/type.rb2
3 files changed, 6 insertions, 2 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 555eea7..e547be9 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,5 +1,7 @@
AllCops:
- TargetRubyVersion: 2.5
+ TargetRubyVersion: 3.0
+
+ NewCops: enable
DisplayCopNames: true
DisplayStyleGuide: false
diff --git a/_plugins/twitter.rb b/_plugins/twitter.rb
index cfbef5d..4f2f3d2 100644
--- a/_plugins/twitter.rb
+++ b/_plugins/twitter.rb
@@ -26,7 +26,7 @@ module Jekyll
DEFAULT_PATH = "/images/default.png"
def render(context)
- img = normalize(context["raw_title"]) + ".png"
+ img = "#{normalize(context["raw_title"])}.png"
path = image_exists?(img) ? "/images/posts/#{img}" : DEFAULT_PATH
render_meta("og:image", "http://jo.mssola.com#{path}") +
render_meta("og:image:width", 630) +
diff --git a/_plugins/type.rb b/_plugins/type.rb
index 2d9ac92..8c4c2b8 100644
--- a/_plugins/type.rb
+++ b/_plugins/type.rb
@@ -39,6 +39,7 @@ module Jekyll
def render_article_tags(page)
tags = page["tags"].inject("") { |acc, t| acc + render_meta("article:tag", t) }
+ # rubocop:disable Style/StringConcatenation
'<meta property="og:type" content="article" />' +
render_meta("og:author", "Miquel Sabaté Solà") +
render_meta("profile:first_name", "Miquel") +
@@ -49,6 +50,7 @@ module Jekyll
render_meta("article:published_time", published_time(page)) +
render_meta("article:modified_time", modified_time(page)) +
tags
+ # rubocop:enable Style/StringConcatenation
end
# Returns the published time of the given page.