Skip to content

Commit

Permalink
accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
loftwah committed Aug 9, 2024
1 parent 1e652f6 commit 23c13c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions app/helpers/open_graph_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 9 additions & 8 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@
<link rel="icon" href="/favicon.ico" type="image/x-icon">

<!-- Open Graph Meta Tags -->
<%= 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 %>
</head>

<body class="bg-gray-900 text-white">
Expand Down

0 comments on commit 23c13c6

Please sign in to comment.