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

41 lines
1.8 KiB
Text
Raw Normal View History

2019-12-04 02:56:39 +01:00
meta name="generator" content="philomena"
meta name="theme-color"
meta name="format-detection" content="telephone=no"
meta name="robots" content="noindex, nofollow"
2019-12-04 03:01:52 +01:00
= if !is_nil(@conn.assigns[:image]) and @conn.assigns.image.__meta__.state == :loaded do
2019-12-04 02:56:39 +01:00
- image = @conn.assigns.image
- filtered = ImageView.filter_or_spoiler_hits?(@conn, image)
meta name="description" content="##{image.id} - Derpibooru"
meta name="keywords" content=image.tag_list_cache
meta name="og:title" content="##{image.id} - Derpibooru"
meta name="og:url" content=Routes.image_url(@conn, :show, image)
= for tag <- artist_tags(image.tags) do
meta property="dc:creator" content=tag.name_in_namespace
= if image.source_url not in [nil, ""] do
meta propery="foaf:primaryTopic" content=image.source_url
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"
= cond do
- image.image_mime_type == "video/webm" and !filtered ->
meta name="og:type" content="video.other"
meta name="og:image" content=ImageView.thumb_url(image, false, :rendered)
2019-12-04 02:57:05 +01:00
meta name="og:video" content=ImageView.thumb_url(image, false, :full)
2019-12-04 02:56:39 +01:00
- image.image_mime_type == "image/svg+xml" and !filtered ->
2019-12-04 05:14:56 +01:00
meta name="og:type" content="website"
2019-12-04 02:56:39 +01:00
meta name="og:image" content=ImageView.thumb_url(image, false, :rendered)
- !filtered ->
meta name="og:type" content="website"
meta name="og:image" content=ImageView.thumb_url(image, false, :full)
- true ->
meta name="og:type" content="website"
- else
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"