56 lines
2.5 KiB
Plaintext
56 lines
2.5 KiB
Plaintext
<% content_for :head do %>
|
|
<% log_entry = @post.primary_file_for_view&.log_entry %>
|
|
<% if log_entry && is_flash_content_type?(log_entry.content_type) %>
|
|
<script src="https://unpkg.com/@ruffle-rs/ruffle"></script>
|
|
<style type="text/css" data-turbolinks-track>
|
|
embed,
|
|
ruffle-embed {
|
|
width: 100%;
|
|
border-radius: 0.5rem;
|
|
overflow: hidden;
|
|
}
|
|
</style>
|
|
<% end %>
|
|
<% if log_entry && is_renderable_image_type?(log_entry.content_type) && (log_entry.status_code == 200) && (blob_entry = log_entry.response) %>
|
|
<% path = blob_url(
|
|
HexUtil.bin2hex(blob_entry.sha256),
|
|
format: extension_for_content_type(blob_entry.content_type),
|
|
thumb: "content-container",
|
|
)
|
|
%>
|
|
<meta name="og:image" content="<%= path %>">
|
|
<meta name="og:image:type" content="image/jpeg">
|
|
<meta name="og:image:width" content="1200">
|
|
<meta name="og:image:height" content="630">
|
|
<meta name="twitter:card" content="summary_large_image">
|
|
<meta name="twitter:image" content="<%= path %>">
|
|
<meta name="twitter:image:alt" content="<%= @post.title %>">
|
|
<% end %>
|
|
<%
|
|
description = []
|
|
description << "posted #{@post.posted_at.strftime("%B %d, %Y")}" if @post.respond_to?(:posted_at) && @post.posted_at.present?
|
|
description << "by #{@post.primary_creator_for_view&.name_for_view || "Unknown"}"
|
|
description << "@ #{domain_name_for_model(@post)}"
|
|
%>
|
|
<meta name="og:description" content="<%= description.join(" ") %>">
|
|
<meta name="og:url" content="<%= domain_post_url(@post) %>">
|
|
<meta name="og:type" content="article">
|
|
<%
|
|
site_name = "#{domain_name_for_model(@post)} via ReFurrer"
|
|
%>
|
|
<meta name="og:title" content="<%= @post.title %>">
|
|
<meta name="twitter:title" content="<%= @post.title %>">
|
|
<meta name="og:site_name" content="<%= site_name %>">
|
|
<meta name="og:locale" content="en_US">
|
|
<% end %>
|
|
<div class="mx-auto mt-4 flex w-full max-w-2xl flex-col gap-4 pb-4">
|
|
<%= render_for_model(@post, "section_post_title", as: :post) %>
|
|
<%= render_for_model(@post, "section_post_groups", as: :post) %>
|
|
<%= render_for_model(@post, "section_primary_file", as: :post) %>
|
|
<%= render_for_model(@post, "section_description", as: :post) %>
|
|
<%= render_for_model(@post, "section_tags", as: :post) %>
|
|
<%= render_for_model(@post, "section_sources", as: :post) %>
|
|
<%= render_for_model(@post, "section_visualy_similar_posts", as: :post) %>
|
|
<%= render_for_model(@post, "section_similar_posts", as: :post) %>
|
|
</div>
|