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? %>