Skip to content

Commit

Permalink
Embedd talk specific metatags in speakie details page
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakob Holderbaum committed Jun 24, 2019
1 parent 9b3cfd0 commit 0156b7f
Show file tree
Hide file tree
Showing 27 changed files with 25 additions and 3 deletions.
24 changes: 23 additions & 1 deletion source/events/2019/speakies/template.html.erb
@@ -1,3 +1,5 @@
<% abstract = talk[:abstract].empty? ? "This talk does not have an abstract" : talk[:abstract] %>

<main>
<section class="speaker-details">
<div>
Expand All @@ -21,7 +23,7 @@
</u>
<% end %>
<article>
<%= markdown talk[:abstract] %>
<%= markdown abstract %>
</article>
</div>
</section>
Expand Down Expand Up @@ -54,3 +56,23 @@
<%= partial 'updates' %>
</section>
</main>

<% content_for :metatags do %>
<% title = html_escape strip_tags markdown talk[:title] %>
<% abstract = html_escape strip_tags markdown abstract %>
<% image_path = "https://think-about.io/images/events/2019/speakies/#{talk[:person_slug]}_card.png" %>

<meta property="og:image" content="<%= image_path %>">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:title" content="<%= title %>">
<meta property="og:description" content="<%= abstract %>">
<meta property="og:type" content="article" />
<meta property="og:url" content="<%= "https://think-about.io/#{current_page.url}" %>" />
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@thinkaboutconf">
<meta name="twitter:title" content="<%= title %>">
<meta name="twitter:description" content="<%= abstract %>">
<meta name="twitter:image" content="<%= image_path %>">
<meta name="twitter:domain" content="think-about.io">
<% end %>
4 changes: 2 additions & 2 deletions source/layouts/layout.erb
Expand Up @@ -13,8 +13,8 @@
<meta name="msapplication-TileColor" content="#280050">
<meta name="theme-color" content="#280050">

<% if content_for? :header %>
<%= yield_content :header %>
<% if content_for? :metatags %>
<%= yield_content :metatags %>
<% else %>
<meta property="og:image" content="/images/og-image.jpg">
<meta property="og:title" content="Think About! Conference">
Expand Down

0 comments on commit 0156b7f

Please sign in to comment.