Index: includes/meta/social.tmpl |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/includes/meta/social.tmpl |
@@ -0,0 +1,97 @@ |
+{# |
+ # This file is part of website-defaults |
+ # Copyright (C) 2016-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 as published by |
+ # the Free Software Foundation, either version 3 of the License, or |
+ # (at your option) any later version. |
+ # |
+ # 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/>. |
+ #} |
+ |
+{# open graph #} |
+ |
+{% if og_url %} |
+ <meta property="og:url" content="{{ og_url }}"> |
+{% else %} |
+ <meta property="og:url" content="{{ get_canonical_url(page) }}"> |
+{% endif %} |
+ |
+{% if og_type %} |
+ <meta property="og:type" content="{{ og_type }}"> |
+{% else %} |
+ <meta property="og:type" content="website"> |
+{% endif %} |
+ |
+{% if og_site_name %} |
+ <meta property="og:site_name" content="{{ og_site_name | translate("og-site-name", "meta website name") }}"> |
+{% elif has_string("site-name", "global") %} |
+ <meta property="og:site_name" content="{{ get_string("site-name", "global") }}"> |
+{% endif %} |
+ |
+{% if og_title %} |
+ <meta property="og:title" content="{{ og_title | translate("og-title", "meta page title") }}"> |
+{% elif title %} |
+ <meta property="og:title" content="{{ title | translate("page-title") }}"> |
+{% endif %} |
+ |
+{% if og_description %} |
+ <meta property="og:description" content="{{ og_description | translate("og-description", "meta page description") }}"> |
+{% elif description %} |
+ <meta property="og:description" content="{{ description | translate("page-description") }}"> |
+{% endif %} |
+ |
+{% if og_image %} |
+ <meta property="og:image" content="{{ og_image }}"> |
+{% elif image %} |
+ <meta property="og:image" content="{{ image }}"> |
+{% endif %} |
+ |
+<meta property="og:locale" content="{{ locale | to_og_locale }}"> |
+ |
+{% for alternate_locale in locales %} |
+ {% if alternate_locale != locale %} |
+ <meta property="og:locale:alternate" content="{{ alternate_locale | to_og_locale }}"> |
+ {% endif %} |
+{% endfor %} |
+ |
+{# facebook #} |
+ |
+{% if facebook_id %} |
+ <meta property="fb:app_id" content="{{ facebook_id }}"> |
+{% endif %} |
+ |
+{# twitter #} |
+ |
+{% if twitter_site %} |
+ <meta name="twitter:site" content="@{{ twitter_site }}"> |
+{% else %} |
+ <meta name="twitter:site" content="@eyeo"> |
+{% endif %} |
+ |
+{% if twitter_card %} |
+ <meta name="twitter:card" content="{{ twitter_card }}"> |
+{% elif og_image or 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 | translate("twitter-image-alt", "meta featured image alternate text") }}"> |
+{% elif image_alt %} |
+ <meta name="twitter:image:alt" content="{{ image_alt | translate("image-alt", "meta featured image alternate text") }}"> |
+{% endif %} |
+ |
+{# pinterest #} |
+ |
+{% if pinterest_id %} |
+ <meta name="p:domain_verify" content="{{ pinterest_id }}"> |
+{% endif %} |