diff options
Diffstat (limited to 'app/views/layouts/_social_meta.html.erb')
| -rw-r--r-- | app/views/layouts/_social_meta.html.erb | 34 |
1 files changed, 34 insertions, 0 deletions
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 @@ | |||
| 1 | <% if (directive = robots_directive) %> | ||
| 2 | <meta name="robots" content="<%= directive %>"/> | ||
| 3 | <% end %> | ||
| 4 | |||
| 5 | <% if social_meta? %> | ||
| 6 | <meta name="description" content="<%= og_description %>"/> | ||
| 7 | |||
| 8 | <link rel="canonical" href="<%= og_canonical_url %>"/> | ||
| 9 | |||
| 10 | <meta property="og:site_name" content="<%= SocialHelper::OG_SITE_NAME %>"/> | ||
| 11 | <meta property="og:type" content="<%= og_type %>"/> | ||
| 12 | <meta property="og:url" content="<%= og_canonical_url %>"/> | ||
| 13 | <meta property="og:title" content="<%= og_title %>"/> | ||
| 14 | <meta property="og:description" content="<%= og_description %>"/> | ||
| 15 | |||
| 16 | <meta property="og:image" content="<%= og_image_url %>"/> | ||
| 17 | <meta property="og:image:width" content="<%= og_image_width %>"/> | ||
| 18 | <meta property="og:image:height" content="<%= og_image_height %>"/> | ||
| 19 | <meta property="og:image:alt" content="<%= og_image_alt %>"/> | ||
| 20 | |||
| 21 | <meta property="og:locale" content="<%= og_locale %>"/> | ||
| 22 | <% og_locale_alternates.each do |alternate| %> | ||
| 23 | <meta property="og:locale:alternate" content="<%= alternate %>"/> | ||
| 24 | <% end %> | ||
| 25 | |||
| 26 | <% if og_published_time %> | ||
| 27 | <meta property="article:published_time" content="<%= og_published_time %>"/> | ||
| 28 | <% end %> | ||
| 29 | |||
| 30 | <%# X ignores og:image unless the card type is declared, and falls back | ||
| 31 | to a small square thumbnail. twitter:image is deliberately absent: | ||
| 32 | with only twitter:card set, X reuses og:image. %> | ||
| 33 | <meta name="twitter:card" content="summary_large_image"/> | ||
| 34 | <% end %> | ||
