generated from greenelab/lab-website-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeta.html
99 lines (83 loc) · 3.13 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
96
97
98
99
{% assign filename = page.path | split: "/" | last %}
{% if page.name and page.name != filename %}
{% assign title = page.name %}
{% elsif page.title %}
{% assign title = page.title %}
{% else %}
{% assign title = nil %}
{% endif %}
{% assign fulltitle = "" | split: "," %}
{% if title %}
{% assign fulltitle = fulltitle | push: title %}
{% endif %}
{% if site.title %}
{% assign fulltitle = fulltitle | push: site.title %}
{% endif %}
{% assign fulltitle = fulltitle | join: " | " %}
{% assign subtitle = site.subtitle %}
{% assign description = page.description | default: site.description %}
{% if site.subtitle %}
{% capture description -%}
{{ site.subtitle }}. {{ description }}
{%- endcapture %}
{% endif %}
{% capture url -%}
{{ site.url }}{{ site.baseurl }}
{%- endcapture %}
{% assign png = "images/icon.png" | file_exists %}
{% assign jpg = "images/icon.jpg" | file_exists %}
{% assign icon = png | default: jpg | relative_url %}
{% assign jpg = "images/share.jpg" | file_exists %}
{% assign png = "images/share.png" | file_exists %}
{% assign share = jpg | default: png | relative_url %}
{% assign published = page.date | date_to_xmlschema %}
{% assign updated = page.last_modified_at | date_to_xmlschema %}
{% assign feed = "feed.xml" | absolute_url %}
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ fulltitle }}</title>
<link rel="icon" href="{{ icon }}">
<meta name="title" content="{{ title }}">
<meta name="description" content="{{ description }}">
<meta property="og:title" content="{{ title }}">
<meta property="og:site_title" content="{{ site.title }}">
<meta property="og:description" content="{{ description }}">
<meta property="og:url" content="{{ url }}">
<meta property="og:image" content="{{ share }}">
<meta property="og:locale" content="en_US">
<meta property="twitter:title" content="{{ title }}">
<meta property="twitter:description" content="{{ description }}">
<meta property="twitter:url" content="{{ url }}">
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:image" content="{{ share }}">
{% if page.author %}
<meta name="author" content="{{ page.author }}">
<meta property="og:type" content="article">
<meta property="og:updated_time" content="{{ updated }}">
<meta property="article:published_time" content="{{ published }}">
<meta property="article:modified_time" content="{{ updated }}">
<meta name="revised" content="{{ updated }}">
{% else %}
<meta property="og:type" content="website">
{% endif %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
{% if page.author %}
"@type": "BlogPosting",
"author": { "@type": "Person", "name": "{{ title }}" },
"datePublished": "{{ published }}",
"dateModified": "{{ updated }}",
{% else %}
"@type": "WebSite",
{% endif %}
"name": "{{ title }}",
"description": "{{ description }}",
"headline": "{{ title }}",
"publisher": {
"@type": "Organization",
"logo": { "@type": "ImageObject", "url": "{{ icon }}" }
},
"url": "{{ url }}"
}
</script>
<link rel="alternate" type="application/rss+xml" href="{{ feed }}">