PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/modules/mod_seo/templates/_html_head.tpl

http://github.com/zotonic/zotonic
Smarty Template | 57 lines | 56 code | 1 blank | 0 comment | 21 complexity | df30e4c6fc2d25a618fc472f6082598b MD5 | raw file
 1{% if id %}
 2	<link rel="shorturl" href="{% url id id=id %}" />
 3	<link rel="canonical" href="{{ m.rsc[id].page_url }}" />
 4{% endif %}
 5
 6{% if m.config.seo.noindex.value or noindex %}
 7	<meta name="robots" content="noindex,nofollow" />
 8{% elseif id and id.language and m.modules.active.mod_translation and not z_language|member:id.language %}
 9	{# Take one of the alternative urls, provided by mod_translation #}
10	<meta name="robots" content="noindex" />
11{% else %}
12	{% with m.config.seo.keywords.value as keywords %}
13	{% with m.config.seo.description.value as description %}
14		{% if id %}
15			{% if m.rsc[id].seo_noindex %}
16				{% if not m.config.seo.noindex.value %}<meta name="robots" content="noindex" />{% endif %}
17			{% else %}
18				{% with m.rsc[id].seo_keywords as seo_keywords %}
19					{% if seo_keywords %}
20						<meta name="keywords" content="{{ seo_keywords }}, {{ keywords }}" />
21					{% else %}
22						<meta name="keywords" content="{% for predicate in id.op %}{% if predicate /= "depiction" %}{% for oid in id.o[predicate] %}{{ oid.title }}, {% endfor %}{% endif %}{% endfor %}{{ keywords }}" />
23					{% endif %}
24					<meta name="description" content="{{ id.seo_desc|default:id.summary|default:description|escape }}" />
25				{% endwith %}
26			{% endif %}
27		{% else %}
28			{% if keywords %}
29				<meta name="keywords" content="{{ keywords }}" />
30			{% endif %}
31			{% if description %}
32				<meta name="description" content="{{ description }}" />
33			{% endif %}
34		{% endif %}
35	{% endwith %}
36	{% endwith %}
37{% endif %}
38{% with m.config.seo_bing.webmaster_verify.value as wmv %}{% if wmv %}
39	<meta name="msvalidate.01" content="{{ wmv }}" />
40{% endif %}{% endwith %}
41{% with m.config.seo_google.webmaster_verify.value as wmv %}{% if wmv %}
42	<meta name="google-site-verification" content="{{ wmv }}" />
43{% endif %}{% endwith %}
44{% if m.acl.user /= 1 and not notrack %}
45	{% with m.config.seo_google.analytics.value as ga %}{% if ga %}
46	<script>
47		window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
48		{% if m.acl.user %}
49			ga('create', "{{ ga|escapejs }}", 'auto', { userId: "{{ m.acl.user|escapejs }}" });
50		{% else %}
51			ga('create', "{{ ga|escapejs }}", 'auto');
52		{% endif %}
53		ga('send', 'pageview');
54	</script>
55	<script async src='https://www.google-analytics.com/analytics.js'></script>
56	{% endif %}{% endwith %}
57{% endif %}