diff --git a/app/helpers/open_graph_helper.rb b/app/helpers/open_graph_helper.rb index c8c3ab8..ba529c0 100644 --- a/app/helpers/open_graph_helper.rb +++ b/app/helpers/open_graph_helper.rb @@ -5,6 +5,7 @@ def set_open_graph_tags(user) content_for :og_title, user.full_name content_for :og_description, user.description.truncate(160) content_for :og_image, url_for("/uploads/og_images/#{user.username}_og.png") + content_for :og_image_alt, "#{user.full_name}'s profile image" content_for :og_url, user_links_url(user.username) end end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 87290c3..0c04b7e 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -12,15 +12,16 @@ - <%= tag.meta property: 'og:type', content: 'website' %> - <%= tag.meta property: 'og:site_name', content: 'Linkarooie' %> - <%= tag.meta property: 'og:locale', content: 'en_US' %> - <%= tag.meta property: 'og:updated_time', content: '2024-08-08T12:00:19Z' %> + <%= tag.meta property: 'og:type', content: 'website' %> + <%= tag.meta property: 'og:site_name', content: 'Linkarooie' %> + <%= tag.meta property: 'og:locale', content: 'en_US' %> + <%= tag.meta property: 'og:updated_time', content: '2024-08-08T12:00:19Z' %> - <%= tag.meta property: 'og:title', content: content_for?(:og_title) ? content_for(:og_title) : 'Linkarooie - Simplify Your Online Presence' %> - <%= tag.meta property: 'og:description', content: content_for?(:og_description) ? content_for(:og_description) : 'Manage all your links in one place with Linkarooie.' %> - <%= tag.meta property: 'og:image', content: content_for?(:og_image) ? content_for(:og_image) : image_url('default_og_image.png') %> - <%= tag.meta property: 'og:url', content: content_for?(:og_url) ? content_for(:og_url) : root_url %> + <%= tag.meta property: 'og:title', content: content_for?(:og_title) ? content_for(:og_title) : 'Linkarooie - Simplify Your Online Presence' %> + <%= tag.meta property: 'og:description', content: content_for?(:og_description) ? content_for(:og_description) : 'Manage all your links in one place with Linkarooie.' %> + <%= tag.meta property: 'og:image', content: content_for?(:og_image) ? content_for(:og_image) : image_url('default_og_image.png') %> + <%= tag.meta property: 'og:image:alt', content: content_for?(:og_image_alt) ? content_for(:og_image_alt) : 'Default image description' %> + <%= tag.meta property: 'og:url', content: content_for?(:og_url) ? content_for(:og_url) : root_url %>