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

Delta Between Two Patch Sets: includes/meta/social.tmpl

Issue 29680647: Issue 5329 - Provide a template for social media meta data in website-defaults (Closed) Base URL: https://hg.adblockplus.org/website-defaults
Left Patch Set: Addressed comments #3 Created Jan. 30, 2018, 8:18 a.m.
Right Patch Set: Addressed NITs Created Feb. 1, 2018, 9:06 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « filters/to_og_locale.py ('k') | macros/meta-tag.tmpl » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 {% from "macros/meta-tag" import meta_tag %} 1 {% from "macros/meta-tag" import meta_tag %}
2 2
3 {% set social_media_meta = [ 3 {% set social_media_meta = [
4 ('og:url', 4 ('og:url',
5 og_url, 5 og_url,
6 get_canonical_url(page)), 6 get_canonical_url(page)),
7 ('og:type', 7 ('og:type',
8 og_type, 8 og_type,
9 'website'), 9 'website'),
10 ('og:site_name', 10 ('og:site_name',
11 og_site_name, 11 og_site_name,
12 get_string('name', 'site') if has_string('name', 'site') else None), 12 get_string('name', 'site') if has_string('name', 'site')),
13 ('og:title', 13 ('og:title',
14 og_title | translate('og-title', 'Meta data') if og_title, 14 og_title | translate('og-title', 'Meta data') if og_title,
15 title | translate('title', 'Meta data') if title else None), 15 title | translate('title', 'Meta data') if title),
16 ('og:description', 16 ('og:description',
17 og_description | translate('og-description', 'Meta data') if og_description, 17 og_description | translate('og-description', 'Meta data') if og_description,
18 description | translate('page-description', 'Meta data') if description), 18 description | translate('page-description', 'Meta data') if description),
19 ('og:image', 19 ('og:image',
20 og_image, 20 og_image,
21 featured_img_url), 21 featured_img_url),
22 ('og:image:alt', 22 ('og:image:alt',
23 og_image_alt, 23 og_image_alt,
24 featured_img_alt), 24 featured_img_alt),
25 ('og:locale', 25 ('og:locale',
26 og_locale, 26 og_locale,
27 locale | to_og_locale), 27 locale | to_og_locale),
28 28
29 ('twitter:site', 29 ('twitter:site',
30 '@' + twitter_site if twitter_site, 30 '@' + twitter_site if twitter_site,
31 '@' + config.get('social', 'twitter') if config.has_option('social', 'twitte r') else '@eyeo'), 31 '@' + config.get('social', 'twitter') if config.has_option('social', 'twitte r') else '@eyeo'),
32 ('twitter:card', 32 ('twitter:card',
33 twitter_card, 33 twitter_card,
34 'summary_large_image' if og_image or twitter_image or featured_img_url else 'summary'), 34 'summary_large_image' if og_image or twitter_image or featured_img_url else 'summary'),
35 ('twitter:image', 35 ('twitter:image',
36 twitter_image, 36 twitter_image,
37 featured_img_url), 37 featured_img_url),
38 ('twitter:image:alt', 38 ('twitter:image:alt',
39 twitter_image_alt, 39 twitter_image_alt,
40 featured_img_alt), 40 featured_img_alt),
41 41
42 ('fb:app_id', 42 ('fb:app_id',
43 facebook_id, 43 facebook_id,
44 config.get('social', 'facebook_id') if config.has_option('social', 'facebook _id')), 44 config.get('social', 'facebook_id') if config.has_option('social', 'facebook _id')),
45 45
46 ('p:domain_verify', 46 ('p:domain_verify',
47 pinterest_id, 47 pinterest_id,
48 config.has_option('social', 'pinterest_id') if config.has_option('social', ' pinterest_id')), 48 config.has_option('social', 'pinterest_id') if config.has_option('social', ' pinterest_id')),
49 ] %} 49 ] %}
50 50
51 {% for property, content, defaultContent in social_media_meta %} 51 {% for property, content, defaultContent in social_media_meta %}
52 {{ meta_tag(property, content, defaultContent) }} 52 {{ meta_tag(property, content, defaultContent) }}
53 {% endfor %} 53 {% endfor %}
LEFTRIGHT

Powered by Google App Engine
This is Rietveld