-
Notifications
You must be signed in to change notification settings - Fork 12
/
seo-meta.html
76 lines (76 loc) · 3.35 KB
/
seo-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
<meta property="og:title" content="{{ page.title }}" />
<meta name="twitter:title" content="{{ page.title }}" />
<meta property="og:url" content="{{ site.url }}{{ page.url }}" />
<meta property="og:site_name" content="{{ site.title }}" />
<meta name="application-name" content="{{ site.title }}" />
<meta name="twitter:site" content="{{ site.twitter_account }}" />
<meta name="twitter:card" content="summary_large_image" />
{% if page.excerpt %}
<meta name="description" content="{{ page.excerpt | strip_html | truncate: 155 }}" />
<meta property="og:description" content="{{ page.excerpt | strip_html }}" />
<meta name="twitter:description" content="{{ page.excerpt | strip_html | truncate: 200 }}" />
{% else %}
<meta name="description" content="{{ site.description }}">
<meta property="og:description" content="{{ site.description }}">
{% endif %}
{% if page.date %}
<meta property="og:type" content="article" />
{% if page.categories.first == "projects" %}
{% capture currentYear %}{{ site.time | truncate: 4, "" }}{% endcapture %}
{% capture postYear %}{{ page.date | truncate: 4, "" }}{% endcapture %}
{% if currentYear == postYear %}
<meta property="og:article:published_date" content="{{ page.date | date: "%F" | truncate: 4, "" }}" />
{% else %}
<meta property="og:article:published_date" content="{{ page.date | date: "%F" }}" />
{% endif %}
{% else %}
<meta property="og:article:published_date" content="{{ page.date | date: "%F" }}" />
{% endif %}
{% if page.author %}
<meta name="author" content="{{ page.author }}" />
<meta property="og:article:author" content="{{ page.author }}" />
{% endif %}
{% if page.categories %}
<meta property="og:article:section" content="{{ page.categories | join: " - " }}" />
{% endif %}
{% if page.tags %}
{% for tag in page.tags %}
<meta property="og:article:tag" content="{{ tag }}" />
{% endfor %}
{% endif %}
{% else %}
<meta property="og:type" content="website" />
{% endif %}
{% if page.images %}
<meta property="og:image" content="{{ site.url }}{{ page.images.first }}" />
<meta name="twitter:image" content="{{ site.url }}{{ page.images.first }}" />
{% else %}
<meta property="og:image" content="{{ site.url }}/img/logo.png" />
<meta name="twitter:image" content="{{ site.url }}/img/logo.png" />
{% endif %}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"name": "{{ site.title }}",
"alternateName": "{{ site.title-abbrev }}",
"logo": "{{ site.url }}/img/logo.png",
"url": "{{ site.url }}",
"sameAs": [
"https://twitter.com/{{ site.twitter_account }}"
],
"knowsAbout": [
"Linux",
"Open source"
],
"location": {
"@type": "Place",
"name": "Rochester Institute of Technology",
"address": {
"@type": "PostalAddress",
"addressLocality": "Henrietta",
"addressRegion": "NY"
}
}
}
</script>