Skip to content

Commit

Permalink
fix duplicated prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed May 29, 2024
1 parent d6b93b5 commit 02a4479
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _plugins/gtn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ def get_og_title(site, page, reverse)

if site.data.key?(topic_id)
if site.data[topic_id].is_a?(Hash) && site.data[topic_id].key?('title')
og_title = [site.data[topic_id]['title']]
og_title = [site.data[topic_id]['title'].clone]
else
Jekyll.logger.warn "Missing title for #{topic_id}"
end
Expand Down Expand Up @@ -701,9 +701,9 @@ def get_og_title(site, page, reverse)
when 'learning-pathway'
og_title.push "Learning Pathway: #{page['title']}"
when 'tutorial_hands_on'
og_title[-1]&.prepend 'Hands-on: '
og_title.push "Hands-on: #{page['title']}"
when /slides/
og_title[-1]&.prepend 'Slide Deck: '
og_title.push "Slides: #{page['title']}"
else
og_title.push page['title']
end
Expand Down

0 comments on commit 02a4479

Please sign in to comment.