2019-12-04 02:56:39 +01:00
meta name="generator" content="philomena"
2019-12-19 16:59:36 +01:00
meta name="theme-color" content="#618fc3"
2019-12-04 02:56:39 +01:00
meta name="format-detection" content="telephone=no"
2019-12-04 22:47:46 +01:00
= if opengraph?(@conn) do
2019-12-04 02:56:39 +01:00
- image = @conn.assigns.image
2019-12-20 21:57:20 +01:00
- filtered = not image.thumbnails_generated
2024-05-20 19:04:12 +02:00
- description = "##{image.id} - #{Philomena.Images.tag_list(image)} - #{site_name()}"
2023-03-29 17:12:06 +02:00
- thumb_large = ImageView.thumb_urls(image, false)[:large]
- thumb_rendered = ImageView.thumb_url(image, false, :rendered)
2019-12-04 02:56:39 +01:00
2021-07-16 02:14:41 +02:00
meta name="keywords" content=tag_list(image)
2019-12-19 16:59:36 +01:00
meta name="description" content=description
2019-12-19 16:51:13 +01:00
meta property="og:title" content=description
2024-06-06 22:28:35 +02:00
meta property="og:url" content=url(~p"/images/#{image}")
2019-12-04 02:56:39 +01:00
= for tag <- artist_tags(image.tags) do
meta property="dc:creator" content=tag.name_in_namespace
2023-05-29 13:06:41 +02:00
= if image_has_sources(image) do
meta property="foaf:primaryTopic" content=image_first_source(image)
2019-12-04 02:56:39 +01:00
2024-06-06 22:28:35 +02:00
link rel="alternate" type="application/json+oembed" href=url(~p"/api/v1/json/oembed?#{[url: ~p"/images/#{image}"]}") title="oEmbed JSON Profile"
2019-12-04 02:56:39 +01:00
2024-06-06 22:28:35 +02:00
link rel="canonical" href=url(~p"/images/#{image}")
2019-12-20 07:00:53 +01:00
2019-12-04 02:56:39 +01:00
= cond do
2019-12-19 16:43:07 +01:00
- image.image_mime_type == "video/webm" and not filtered ->
2019-12-19 16:51:13 +01:00
meta property="og:type" content="video.other"
2023-03-29 17:12:06 +02:00
meta property="og:image" content=thumb_rendered
meta property="og:video" content=thumb_large
2019-12-04 02:56:39 +01:00
2019-12-19 16:43:07 +01:00
- image.image_mime_type == "image/svg+xml" and not filtered ->
2019-12-19 16:51:13 +01:00
meta property="og:type" content="website"
2023-03-29 17:12:06 +02:00
meta property="og:image" content=thumb_rendered
2019-12-04 02:56:39 +01:00
2019-12-19 16:43:07 +01:00
- not filtered ->
2019-12-19 16:51:13 +01:00
meta property="og:type" content="website"
2023-03-29 17:12:06 +02:00
meta property="og:image" content=thumb_large
2019-12-04 02:56:39 +01:00
- true ->
2019-12-19 16:51:13 +01:00
meta property="og:type" content="website"
2019-12-04 02:56:39 +01:00
- else
2024-05-20 19:04:12 +02:00
meta name="description" content=gettext("%{site_name} is a linear imagebooru which lets you share, find and discover new art and media.", site_name: site_name())