aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl/vintage
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2018-08-13 10:42:27 +0200
committerArthurHoaro <arthur@hoa.ro>2018-08-13 10:55:48 +0200
commita120fb2977331e0f7d7ffe05861ba179fdae8764 (patch)
treedb25468102f9deb9bff0ebe0efaa909810efad40 /tpl/vintage
parenta4f0509a77a39d1ac834d4967e3e8f245de6d68d (diff)
downloadShaarli-a120fb2977331e0f7d7ffe05861ba179fdae8764.tar.gz
Shaarli-a120fb2977331e0f7d7ffe05861ba179fdae8764.tar.zst
Shaarli-a120fb2977331e0f7d7ffe05861ba179fdae8764.zip
Add OpenGraph meta tags on permalink page
Includes: - og:title - og:type -> article - og:image -> if there is a thumbnail - og:url -> permalink - og:description -> first 300 chars of raw description - article:published_time - article:modified_time - article:tag -> one OG meta tag for each shaare tag Fixes #258
Diffstat (limited to 'tpl/vintage')
-rw-r--r--tpl/vintage/includes.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/tpl/vintage/includes.html b/tpl/vintage/includes.html
index 410b466b..df093495 100644
--- a/tpl/vintage/includes.html
+++ b/tpl/vintage/includes.html
@@ -12,3 +12,23 @@
12{/loop} 12{/loop}
13{if="is_file('data/user.css')"}<link type="text/css" rel="stylesheet" href="data/user.css#" />{/if} 13{if="is_file('data/user.css')"}<link type="text/css" rel="stylesheet" href="data/user.css#" />{/if}
14<link rel="search" type="application/opensearchdescription+xml" href="?do=opensearch#" title="Shaarli search - {$shaarlititle|htmlspecialchars}"/> 14<link rel="search" type="application/opensearchdescription+xml" href="?do=opensearch#" title="Shaarli search - {$shaarlititle|htmlspecialchars}"/>
15{if="! empty($links) && count($links) === 1"}
16 {$link=reset($links)}
17 <meta property="og:title" content="{$link.title}" />
18 <meta property="og:type" content="article" />
19 <meta property="og:url" content="{$index_url}?{$link.shorturl}" />
20 {$ogDescription=isset($link.description_src) ? $link.description_src : $link.description}
21 <meta property="og:description" content="{function="mb_substr($ogDescription, 0, 300)"}" />
22 {if="$link.thumbnail"}
23 <meta property="og:image" content="{$index_url}{$link.thumbnail}" />
24 {/if}
25 {if="!$hide_timestamps || $is_logged_in"}
26 <meta property="article:published_time" content="{$link.created->format(DateTime::ATOM)}" />
27 {if="$link.updated"}
28 <meta property="article:modified_time" content="{$link.updated->format(DateTime::ATOM)}" />
29 {/if}
30 {/if}
31 {loop="link.taglist"}
32 <meta property="article:tag" content="{$value}" />
33 {/loop}
34{/if}