diff --git a/app/views/cards/index.html.erb b/app/views/cards/index.html.erb index 3ac8073e3..c82053692 100644 --- a/app/views/cards/index.html.erb +++ b/app/views/cards/index.html.erb @@ -2,6 +2,12 @@ <%= render "filters/broadcasts", filter: @filter %> +<% content_for :head do %> + <%= tag.meta property: "og:title", content: @page_title %> + <%= tag.meta property: "og:description", content: Account.sole.name %> + <%= tag.meta property: "og:url", content: cards_url(@filter.as_params) %> +<% end %> + <% content_for :header do %> <%= render "cards/index/header", filter: @filter %> <% end %> diff --git a/app/views/cards/show.html.erb b/app/views/cards/show.html.erb index 185f61955..78e2fd4ef 100644 --- a/app/views/cards/show.html.erb +++ b/app/views/cards/show.html.erb @@ -1,6 +1,13 @@ <% @page_title = @card.title %> <%= turbo_stream_from @card %> +<% content_for :head do %> + <%= tag.meta property: "og:title", content: "#{@card.title} | #{@card.collection.name}" %> + <%= tag.meta property: "og:description", content: format_excerpt(@card&.description, length: 200) %> + <%= tag.meta property: "og:image", content: @card.image.attached? ? "#{request.base_url}#{url_for(@card.image)}" : "#{request.base_url}/app-icon.png" %> + <%= tag.meta property: "og:url", content: collection_card_path(@card.collection, @card) %> +<% end %> + <% content_for :header do %> <% if @card.creating? && @card.can_recover_abandoned_creation? %>
+<% content_for :head do %> + <%= tag.meta property: "og:title", content: "#{@card.title} | #{@card.collection.name}" %> + <%= tag.meta property: "og:description", content: format_excerpt(@card&.description, length: 200) %> + <%= tag.meta property: "og:image", content: @card.image.attached? ? "#{request.base_url}#{url_for(@card.image)}" : "#{request.base_url}/app-icon.png" %> + <%= tag.meta property: "og:url", content: published_card_url(@card) %> + + <%= tag.meta property: "twitter:title", content: "#{@card.title} | #{@card.collection.name}" %> + <%= tag.meta property: "twitter:description", content: format_excerpt(@card&.description, length: 200) %> + <%= tag.meta property: "twitter:image", content: @card.image.attached? ? "#{request.base_url}#{url_for(@card.image)}" : "#{request.base_url}/app-icon.png" %> + <%= tag.meta property: "twitter:card", content: "summary_large_image" %> +<% end %> + <% content_for :header do %>
<%= link_to published_collection_url(@card.collection), class: "header__title btn borderless txt-large", style: "--btn-padding: 0.25ch 1ch 0.25ch 0.75ch; view-transistion-name: card-collection-title;", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" } do %> diff --git a/app/views/public/collections/show.html.erb b/app/views/public/collections/show.html.erb index 3d7c2eba6..98df479b5 100644 --- a/app/views/public/collections/show.html.erb +++ b/app/views/public/collections/show.html.erb @@ -1,5 +1,17 @@ <% @page_title = @collection.name %> +<% content_for :head do %> + <%= tag.meta property: "og:title", content: "#{@collection.name} | #{Account.sole.name}" %> + <%= tag.meta property: "og:description", content: format_excerpt(@collection&.public_description, length: 200) %> + <%= tag.meta property: "og:image", content: "#{request.base_url}/app-icon.png" %> + <%= tag.meta property: "og:url", content: published_collection_url(@collection) %> + + <%= tag.meta property: "twitter:title", content: "#{@collection.name} | #{Account.sole.name}" %> + <%= tag.meta property: "twitter:description", content: format_excerpt(@collection&.public_description, length: 200) %> + <%= tag.meta property: "twitter:image", content: "#{request.base_url}/app-icon.png" %> + <%= tag.meta property: "twitter:card", content: "summary_large_image" %> +<% end %> + <% content_for :header do %>