-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseo.html
89 lines (74 loc) · 3.57 KB
/
seo.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
{% assign seo_title = site.title %}
{% if page.title and page.title != "About" %}
{% assign seo_title = site.title | append: " " | append: site.title_separator | append: " " | append: page.title %}
{% endif %}
{% assign seo_title = seo_title | markdownify | strip_html | strip_newlines | escape_once %}
{% assign canonical_url = page.url | replace: "index.html", "" | prepend: site.url %}
{% assign seo_author = page.author | default: page.author | default: site.author %}
{% assign seo_description = page.description | default: page.excerpt | default: seo_author.bio-short %}
{% assign seo_description = seo_description | markdownify | strip_html | strip_newlines | escape_once %}
{% assign seo_author_twitter = seo_author.social.x-twitter | replace: "@", "" | split: "/" | last %}
{% assign og_image = seo_author.og_image %}
{% if page.header.image %}
{% assign og_image = page.header.image %}
{% elsif page.header.overlay_image %}
{% assign og_image = page.header.overlay_image %}
{% endif %}
{% assign og_image = og_image | prepend: "/assets/img/" | absolute_url %}
<title>{{ seo_title }}</title>
<meta property="og:site_name" content="{{ seo_author.name }}">
<meta property="og:title"
content="{{ page.title | default: site.title | markdownify | strip_html | strip_newlines | escape_once }}">
<meta name="twitter:title"
content="{{ page.title | default: site.title | markdownify | strip_html | strip_newlines | escape_once }}">
<meta name="author" content="{{ seo_author.name }}">
<meta name="keywords" content="{{ seo_author.name }}">
<meta property="og:locale" content="{{ page.locale | default: site.locale | replace: " -", "_" }}">
<meta name="description" content="{{ seo_description }}">
<meta property="og:description" content="{{ seo_description }}">
<meta name="twitter:description" content="{{ seo_description }}">
<link rel="canonical" href="{{ canonical_url }}">
<meta property="og:url" content="{{ canonical_url }}">
<meta name="twitter:url" content="{{ canonical_url }}">
<meta property="og:site_name" content="{{ site.title }}">
<meta name="twitter:site" content="@{{ seo_author_twitter }}">
<meta name="twitter:creator" content="@{{ seo_author_twitter }}">
{% if page.header.image %}
<meta property="og:image" content="{{ og_image }}">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{{ og_image }}">
{% elsif page.header.overlay_image %}
<meta property="og:image" content="{{ og_image }}">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{{ og_image }}">
{% else %}
<meta name="twitter:card" content="summary">
{% if seo_author.og_image %}
<meta property="og:image" content="{{ og_image }}">
<meta name="twitter:image" content="{{ og_image }}">
{% endif %}
{% endif %}
{% if page.date %}
<meta property="og:type" content="article">
<meta property="article:author" content="{{ seo_author.name }}">
<meta property="article:published_time" content="{{ page.date | date_to_xmlschema }}">
{% if page.last_modified_at %}
<meta property="article:modified_time" content="{{ page.last_modified_at | date_to_xmlschema }}">
{% endif %}
{% else %}
<meta property="og:type" content="website">
{% endif %}
{% if paginator.previous_page %}
<link rel="prev" href="{{ paginator.previous_page_path | absolute_url }}">
{% endif %}
{% if paginator.next_page %}
<link rel="next" href="{{ paginator.next_page_path | absolute_url }}">
{% endif %}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Person",
"name": {{ site.title | jsonify }},
"url": {{ "/" | absolute_url | jsonify }}
}
</script>