/
index.html
152 lines (131 loc) · 6.91 KB
/
index.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
{% import "post_macros.html" as post_macros %}
<!DOCTYPE html>
<html lang="en">
<head>
<title>{% if page.title %}{{ config.title }} - {{ page.title }}{% else %}{{ config.title }}{% endif %}</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<!-- Enable responsiveness on mobile devices-->
<!-- viewport-fit=cover is to support iPhone X rounded corners and notch in landscape-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, viewport-fit=cover">
<!-- Standard meta tags -->
{% if page.extra.author %}<meta name="author" content="{{ page.extra.author }}">{% endif %}
{% if page.summary %}<meta name="description" content="{{ page.summary | markdown(inline=true) }}">{% endif %}
<!-- Open Graph Tags -->
<meta property="og:site_name" content="{{ config.title }}">
{% if page %}
<meta property="og:title" content="{{ page.title }}">
<meta property="og:url" content="{{ get_url(path=page.path, trailing_slash=false) }}">
<meta property="og:description" content="{{ page.summary | markdown(inline=true) }}">
{% if page.extra.banner_path %}
<meta property='og:image' content="{{ resize_image(path=page.extra.banner_path, width=1200, height=627, op="fill", format="auto", quality=75) }}"/>
<meta property='og:image:width' content="1200"/>
<meta property='og:image:height' content="627"/>
{% endif %}
<meta property="og:type" content="article">
<meta property="article:published_time" content="{{ page.date | date(format="%Y-%m-%d") }}">
{% if page.updated %}<meta property="article:modified_time" content="{{ page.updated | date(format="%Y-%m-%d") }}">{% endif %}
{% if page.extra.author_url %}<meta property="article:author" content="{{ page.extra.author_url }}">{% endif %}
{% for tag in page.taxonomies.tags %}<meta property="article:tags" content="{{ tag }}">{% endfor %}
{% else %}
<meta property="og:type" content="website">
<meta property="og:url" content="{{ get_url(path="", trailing_slash=false) }}">
{% endif %}
<!-- CSS -->
<link rel="stylesheet" href="{{ get_url(path="main.css", trailing_slash=false) }}">
<!-- Feeds -->
{% block rss %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path="rss.xml", trailing_slash=false) }}">
{% endblock %}
</head>
{% if page %}<body class="single">{% else %}<body class="list">{% endif %}
{% block body %}
<header class="header">
<nav class="nav">
{% if page %}
<p class="logo"><a href="{{ get_url(path="", trailing_slash=false ) }}">{{ config.title }}</a></p>
{% else %}
<h1 class="logo"><a href="{{ get_url(path="", trailing_slash=false ) }}">{{ config.title }}</a></h1>
{% endif %}
<ul class="menu">
{% block sidebar_nav %}{% for link in config.extra.links %}
<li><a href="{{ link.url }}">{{ link.name }}</a></li>
{% endfor %}{% endblock sidebar_nav %}
</ul>
</nav>
</header>
<main class="main">
{% block content %}
<div class="posts">
{% set is_first_page = true %}
{% if paginator is defined %}
{% set pages = paginator.pages %}
{% set is_first_page = paginator.current_index == 1 %}
{% elif section is defined %}
{% set pages = section.pages %}
{% endif %}
{% for page in pages %}
{% if loop.index == 1 and is_first_page %}
<article class="first-entry">{% else %}<article class="post-entry">{% endif %}
{{ post_macros::page_in_list(page=page)}}
</article>{% endfor %}
{% if paginator is defined %}
<footer class="page-footer">
<nav class="pagination">
{% if paginator.previous %}<a class="prev" href="{{ paginator.previous }}">← Previous</a>{% else %}<!--Hidden Previous-Button-->{% endif %}
{% if paginator.next %}<a class="next" href="{{ paginator.next }}">Next →</a>{% else %}<!--Hidden Next-Button-->{% endif %}
</nav>
</footer>
{% endif %}
</div>
{% endblock content %}
</main>
<footer class="footer">
<span><a href="https://www.twitter.com/bob_the_mighty">Bob The Mighty</a></span>
<span>·</span>
<span>Original content <a href="https://creativecommons.org/share-your-work/public-domain/cc0/">Creative commons: No rights reserved</a></span>
<span>·</span>
<span>Powered by <a href="https://www.getzola.org" rel="noopener" target="_blank">Zola</a>️</span>
<span>·</span>
<span>Theme️ <a href="https://github.com/schoenenberg/zola-paper" rel="noopener" target="_blank">Zola-Paper</a></span>
<span>Hosted by <a href="https://pages.cloudflare.com" target="_blank" rel="noopener">Cloudflare Pages</a>
<span>Source on <a href="https://github.com/bobthemighty/codefiend-site" target="_blank" rel="noopener">Github</a>
</footer>
{% endblock body %}
<script type="text/javascript">
// This is my home-brew, privacy-friendly, cookie-free stats script.
// I just want to get some anonymous info about my readers,
// the devices they use to read my blog, and what pages are
// linking to me.
// The code for the setup is at https://github.com/bobthemighty/codefiend-stats
// What time was it when you loaded this page?
let timestamp = Date.now();
// I'd like to know what page you're looking at
// so I know what's popular...
let uri = window.location.href;
// ... and how you found me!
let referrer = document.referrer;
// Get the width rounded down to 50px
// this tells me how big my readers' screens are
// but is too inaccurate to identify you.
let width = window.innerHeight;
width -= width % 50;
let hit = {
u: uri,
r: referrer,
t: timestamp,
v: width
}
const endpoint = 'https://stats.codefiend.co.uk/'
let headers = {
"Content-Type": "application/json",
"X-Api-Key": "gVAPFwd5xc90YQov7pwjl1zhGhHB1Ozw3yBSZmkW"
};
fetch(endpoint,{
method: 'POST',
body: JSON.stringify(hit),
headers
});
</script>
</body>
</html>