Index: includes/meta/social.tmpl |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/includes/meta/social.tmpl |
@@ -0,0 +1,77 @@ |
+{# |
juliandoucette
2017/06/21 12:05:01
Does fb:app_id apply to pages?
ire
2017/06/21 13:20:24
Sorry I think I was unclear with my use of "page".
|
+ # This file is part of the website-defaults, |
+ # Copyright (C) 2017 eyeo GmbH |
+ # |
+ # website-defaults is free software: you can redistribute it and/or modify |
+ # it under the terms of the GNU General Public License version 3 as |
+ # published by the Free Software Foundation. |
+ # |
+ # website-defaults is distributed in the hope that it will be useful, |
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of |
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+ # GNU General Public License for more details. |
+ # |
+ # You should have received a copy of the GNU General Public License |
+ # along with website-defaults. If not, see <http://www.gnu.org/licenses/>. |
+ # |
+ # --- |
+ # |
+ # # Essential meta data for sharing on social media |
ire
2017/06/21 11:39:29
This list in the comments isn't representative of
juliandoucette
2017/06/21 12:05:00
I excluded fields that I automated (e.g.locale).
|
+ # |
+ # og:type |
+ # : Page type (e.g. website, article) |
+ # |
+ # og:site |
ire
2017/06/21 11:39:29
This should be og:site_name
juliandoucette
2017/06/21 12:05:01
Done.
Good catch.
|
+ # : A short name associated with the site (not page) |
+ # |
+ # twitter:site |
+ # : A twitter username associated with the site (not page) |
+ # |
ire
2017/06/21 11:39:29
NIT: Can you group the `og` and the `twitter` meta
juliandoucette
2017/06/21 12:05:01
Acknowledged.
I grouped them categorically. e.g.
juliandoucette
2017/06/21 12:24:16
Done.
|
+ # og:title |
+ # : A clear title without branding or mentioning the domain itself |
+ # |
+ # og:description |
+ # : A clear description, at least two sentences long |
+ # |
+ # og:image |
+ # : Featured image (at least 1200x630, up to 5MB) |
+ #} |
+{% if og_type %} |
+ <meta property="og:type" content="{{ og_type }}"> |
+{% endif %} |
+{% if og_site_name %} |
+ <meta property="og:site_name" content="{{ og_site_name }}"> |
+{% endif %} |
+{% if twitter_site %} |
+ <meta name="twitter:site" content="@{{ twitter_site }}"> |
+{% endif %} |
juliandoucette
2017/06/21 12:05:01
Note: There is another proprietary field for assoc
|
+{% if og_title %} |
+ <meta property="og:title" content="{{ og_title }}"> |
+{% endif %} |
+{% if og_description %} |
+ <meta property="og:descirption" content="{{ og_description }}"> |
+{% endif %} |
+{% if og_image %} |
+ <meta property="og:image" content="{{ og_image }}"> |
+{% else if og_site_image %} |
+ <meta property="og:image" content="{{ og_site_image }}"> |
+{% endif %} |
+{% if twitter_card %} |
+ <meta name="twitter:card" content="{{ twitter_card }}"> |
+{% else if og_image or og_site_image %} |
+ <meta name="twitter:card" content="summary_large_image"> |
+{% else %} |
+ <meta name="twitter:card" content="summary"> |
+{% endif %} |
+{% if twitter_image_alt %} |
+ <meta name="twitter:image:alt" content="{{ twitter_image_alt }}"> |
+{% endif %} |
ire
2017/06/21 11:39:29
These metadata are missing for twitter cards:
twi
juliandoucette
2017/06/21 12:05:00
Falls back to og:image
ire
2017/06/21 13:20:24
Noted.
|
+{% if host and page %} |
+ <meta property="og:url" content="{{ host }}/{{ page }}"> |
+{% endif %} |
+<meta property="og:locale" content="{{ locale }}"> |
+{% for alternate_locale in locales %} |
+ {% if alternate_locale != locale %} |
+ <meta property="og:locale:alternate" content="{{ alternate_locale }}"> |
+ {% endif %} |
+{% endfor %} |