Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: includes/meta/social.tmpl

Issue 29469558: Issue 5329 - Optimize website-boilerplate for sharing on social media networks (Closed) Base URL: https://hg.adblockplus.org/website-defaults
Patch Set: Separated open graph and twitter fields Created June 21, 2017, 12:23 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | includes/meta/standard.tmpl » ('j') | includes/meta/standard.tmpl » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: includes/meta/social.tmpl
===================================================================
new file mode 100644
--- /dev/null
+++ b/includes/meta/social.tmpl
@@ -0,0 +1,87 @@
+{#
+ # 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
+ #
+ # og_type
+ # : Page type (e.g. website, article)
+ #
+ # og_site_name
+ # : A short name associated with the site (not page)
+ #
+ # 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)
+ #
+ # twitter_site
+ # : A twitter username associated with the site (not page)
+ #
+ # twitter_image_alt
+ # : A text description of the nature of the featured image for search engines
+ # and the visually impaired (max 420 characters)
+ #}
+
+<!-- open graph -->
+
+{% if host and page %}
+ <meta property="og:url" content="{{ host }}/{{ page }}">
juliandoucette 2017/06/21 12:30:02 @Vasily and/or @Jon I need `protocol://host.domain
juliandoucette 2017/06/21 15:20:45 Done. https://issues.adblockplus.org/ticket/5343
+{% endif %}
+{% 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 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 %}
+<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 %}
+
+<!-- twitter -->
+
+{% if twitter_site %}
+ <meta name="twitter:site" content="@{{ twitter_site }}">
+{% 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 %}
« no previous file with comments | « no previous file | includes/meta/standard.tmpl » ('j') | includes/meta/standard.tmpl » ('J')

Powered by Google App Engine
This is Rietveld