forked from rstacruz/cheatsheets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeta.html
95 lines (83 loc) · 3.77 KB
/
meta.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<meta charset='utf-8'>
{%comment%}<!-- set the base -->{%endcomment%}
{% assign base = '' %}
{% assign depth = page.url | split: '/' | size | minus: 1 %}
<meta property='page:depth' content='{{depth}}'>
{% if depth <= 1 %}{% assign base = '.' %}
{% elsif depth == 2 %}{% assign base = '..' %}
{% elsif depth == 3 %}{% assign base = '../..' %}
{% elsif depth == 4 %}{% assign base = '../../..' %}{% endif %}
{% assign timestamp = site.time | date: "%Y%m%d%H%M%S" %}
{%comment%}<!-- title -->{%endcomment%}
{% if page.full_title %}
<title>{{ page.full_title }}</title>
<meta content='{{ page.full_title }}' property='og:title'>
<meta content='{{ page.full_title }}' property='twitter:title'>
<meta content='article' property='og:type'>
{% elsif page.title %}
<title>{{ page.title }} cheatsheet</title>
<meta content='{{ page.title }}' property='og:title'>
<meta content='{{ page.title }}' property='twitter:title'>
<meta content='{{ page.type | default: "article" }}' property='og:type'>
{% else %}
<title>{{ site.title }}</title>
<meta content='{{ site.title }}' property='og:title'>
<meta content='{{ site.title }}' property='twitter:title'>
<meta content='{{ page.type | default: "website" }}' property='og:type'>
{% endif %}
{%comment%}<!-- description -->{%endcomment%}
{% if page.description %}
<meta content="{{ page.description }}" name="description">
<meta content="{{ page.description }}" property="og:description">
{% endif %}
{%comment%}<!-- canonical URL -->{%endcomment%}
{% if page.url != '/index.html' %}
<link rel="canonical" href="{{ site.url }}{{ page.url }}">
<meta name="og:url" content="{{ site.url }}{{ page.url }}">
<link rel="prefetch" href="{{ site.url }}">
<link rel="prerender" href="{{ site.url }}">
{% endif %}
{%comment%}<!-- author -->{%endcomment%}
{% if page.author %}
{% for author in site.authors | where: "name", page.author %}
<meta content='{{ author.name }}' name='author'>
{% if author.ogp %}
<meta content='{{ author.ogp }}' property='article:author'>
{% endif %}
{% endfor %}
{% endif %}
{%comment%}<!-- site name -->{%endcomment%}
{% if site.title %}
<meta content='{{ site.title }}' property='og:site_name'>
{% endif %}
{%comment%}<!-- facebook -->{%endcomment%}
{% if site.facebook.app_id %}
<meta content='{{ site.facebook.app_id }}' property='fb:app_id'>
{% endif %}
{% if site.facebook.admin %}
<meta content='{{ site.facebook.admin }}' property='fb:admins'>
{% endif %}
{%comment%}<!-- page meta -->{%endcomment%}
{% if page.date %}
<meta content='{{ page.date | date: "%Y-%m-%d" }}' property='article:published_date'>
{% endif %}
{% if page.image %}
<meta content='{{ page.image }}' property='og:image'>
<meta content='{{ page.image }}' name='twitter:image'>
{% endif %}
{%comment%}<!-- tags -->{%endcomment%}
{% if page.tags[0] %}
<meta content='{{ page.tags[0] }}' property='article:section'>
{% endif %}
{% if page.tags %}
{% for tag in page.tags %}
<meta content='{{ tag }}' property='article:tag'>
{% endfor %}
{% endif %}
{%comment%}<!-- google analytics -->{%endcomment%}
{% if site.analytics %}<script>if(~location.hostname.indexOf("{{site.analytics.hostname}}")){var _gaq=_gaq||[];_gaq.push(["_setAccount","{{ site.analytics.id }}"]);_gaq.push(["_trackPageview"]);(function(){var ga=document.createElement("script");ga.async=true;ga.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(ga,s)})()}</script>{% endif %}
<meta content='IE=edge' http-equiv='X-UA-Compatible'>
<meta content='width=device-width, initial-scale=1.0' name='viewport'>
<link href='{{ base }}/assets/favicon.png' rel='shortcut icon'>
{%comment%}<!-- fouc -->{%endcomment%}
<script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>