diff options
author | ArthurHoaro <arthur@hoa.ro> | 2018-10-06 13:31:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-06 13:31:07 +0200 |
commit | e95247d41dbe3b46c83d97f2a9d0e7bd1194bf08 (patch) | |
tree | 811f5f69ec5c8a364c853b146fcf88c014a28042 /tpl | |
parent | a062416918c964e7551137c08b5b5671e6e2bb7e (diff) | |
parent | a120fb2977331e0f7d7ffe05861ba179fdae8764 (diff) | |
download | Shaarli-e95247d41dbe3b46c83d97f2a9d0e7bd1194bf08.tar.gz Shaarli-e95247d41dbe3b46c83d97f2a9d0e7bd1194bf08.tar.zst Shaarli-e95247d41dbe3b46c83d97f2a9d0e7bd1194bf08.zip |
Merge pull request #1205 from ArthurHoaro/feature/opengraph
Add OpenGraph meta tags on permalink page
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/default/includes.html | 20 | ||||
-rw-r--r-- | tpl/vintage/includes.html | 20 |
2 files changed, 40 insertions, 0 deletions
diff --git a/tpl/default/includes.html b/tpl/default/includes.html index 5ccacaaf..0427e224 100644 --- a/tpl/default/includes.html +++ b/tpl/default/includes.html | |||
@@ -15,3 +15,23 @@ | |||
15 | <link type="text/css" rel="stylesheet" href="data/user.css#" /> | 15 | <link type="text/css" rel="stylesheet" href="data/user.css#" /> |
16 | {/if} | 16 | {/if} |
17 | <link rel="search" type="application/opensearchdescription+xml" href="?do=opensearch#" title="Shaarli search - {$shaarlititle}"/> | 17 | <link rel="search" type="application/opensearchdescription+xml" href="?do=opensearch#" title="Shaarli search - {$shaarlititle}"/> |
18 | {if="! empty($links) && count($links) === 1"} | ||
19 | {$link=reset($links)} | ||
20 | <meta property="og:title" content="{$link.title}" /> | ||
21 | <meta property="og:type" content="article" /> | ||
22 | <meta property="og:url" content="{$index_url}?{$link.shorturl}" /> | ||
23 | {$ogDescription=isset($link.description_src) ? $link.description_src : $link.description} | ||
24 | <meta property="og:description" content="{function="substr($ogDescription, 0, 300)"}" /> | ||
25 | {if="$link.thumbnail"} | ||
26 | <meta property="og:image" content="{$index_url}{$link.thumbnail}" /> | ||
27 | {/if} | ||
28 | {if="!$hide_timestamps || $is_logged_in"} | ||
29 | <meta property="article:published_time" content="{$link.created->format(DateTime::ATOM)}" /> | ||
30 | {if="$link.updated"} | ||
31 | <meta property="article:modified_time" content="{$link.updated->format(DateTime::ATOM)}" /> | ||
32 | {/if} | ||
33 | {/if} | ||
34 | {loop="link.taglist"} | ||
35 | <meta property="article:tag" content="{$value}" /> | ||
36 | {/loop} | ||
37 | {/if} | ||
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} | ||