Skip to content

Commit 48b3ccb

Browse files
authored
Merge pull request #2496 from mroderick/improve-og-tags
fix(social): add image dimensions and alt text to Open Graph tags
2 parents cd866c3 + 22ae326 commit 48b3ccb

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

app/views/shared/_meta_tags.html.haml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
%meta{ property: 'og:type', content: 'website' }
33
%meta{ property: 'og:url', content: request.original_url }
44
%meta{ property: 'og:image', content: image_url('codebar-social.jpg') }
5+
%meta{ property: 'og:image:width', content: '1200' }
6+
%meta{ property: 'og:image:height', content: '630' }
7+
%meta{ property: 'og:image:alt', content: 'codebar - making tech more diverse and welcoming' }
58
%meta{ property: 'og:description', content: 'Making tech more diverse and welcoming by bringing people together and helping teach programming skills.' }
69
%meta{ property: 'og:site_name', content: 'codebar' }
710
%meta{ property: 'og:locale', content: 'en_GB' }

app/views/workshops/_meta_tags.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title = if workshop.virtual?
33
t('workshops.virtual.title_with_date', chapter: workshop.chapter.name, date: humanize_date(workshop.date_and_time))
44
else
5-
t('workshop.title', host: workshop.host.name, date: humanize_date(workshop.date_and_time))
5+
t('workshop.title', host: workshop.host&.name || 'codebar', date: humanize_date(workshop.date_and_time))
66
end
77
url = request.original_url
88
image = workshop.host.try(:image_url).presence || image_url('codebar-social.jpg')

0 commit comments

Comments
 (0)