From 36a4194ee3013dfa834aa8d4d57b0bfacf724a1a Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 30 Jul 2026 04:41:07 +0200 Subject: Emit per-page Open Graph metadata Replaces one hardcoded German description and an unrenderable SVG with per-page title, description, canonical URL, locale and publication date, plus the card variant or a site-wide default. --- app/views/layouts/_social_meta.html.erb | 34 +++++++++++++++++++++++++++++++++ app/views/layouts/application.html.erb | 4 +--- 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 app/views/layouts/_social_meta.html.erb (limited to 'app/views/layouts') diff --git a/app/views/layouts/_social_meta.html.erb b/app/views/layouts/_social_meta.html.erb new file mode 100644 index 00000000..9a86d26d --- /dev/null +++ b/app/views/layouts/_social_meta.html.erb @@ -0,0 +1,34 @@ +<% if (directive = robots_directive) %> + +<% end %> + +<% if social_meta? %> + + + + + + + + + + + + + + + + + <% og_locale_alternates.each do |alternate| %> + + <% end %> + + <% if og_published_time %> + + <% end %> + + <%# X ignores og:image unless the card type is declared, and falls back + to a small square thumbnail. twitter:image is deliberately absent: + with only twitter:card set, X reuses og:image. %> + +<% end %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 6a31104a..5717cebf 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -4,10 +4,8 @@ - - - + <%= render :partial => "layouts/social_meta" %> <%= page_title %> -- cgit v1.3