philomena/lib/philomena_web/templates/layout/_opengraph.html.slime

46 lines
1.9 KiB
Text
Raw Normal View History

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
- description = "##{image.id} - #{Philomena.Images.tag_list(image)} - Derpibooru"
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
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
meta property="og:url" content=Routes.image_url(@conn, :show, 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
= if image_has_sources(image) do
meta property="foaf:primaryTopic" content=image_first_source(image)
2019-12-04 02:56:39 +01:00
link rel="alternate" type="application/json+oembed" href=Routes.api_json_oembed_url(@conn, :index, url: Routes.image_path(@conn, :show, image)) title="oEmbed JSON Profile"
link rel="canonical" href=Routes.image_url(@conn, :show, image)
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
2019-12-19 16:43:07 +01:00
meta name="description" content="Derpibooru is a linear imagebooru which lets you share, find and discover new art and media surrounding the show My Little Pony: Friendship is Magic"