This repository has been archived by the owner on Apr 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdefault.hbs
108 lines (90 loc) · 3.82 KB
/
default.hbs
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
<!DOCTYPE html>
<html lang="{{@site.lang}}">
<head>
<meta charset="UTF-8" />
<meta name="HandheldFriendly" content="True" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="{{primary_author}}" />
<meta name="theme-color" content="#59388D">
<meta name="keywords" content="technik, tech, news, techniknews, technews, shorttech, short, tech, we love tech" />
<link rel="apple-touch-icon" sizes="180x180" href="{{asset "img/favicons/apple-touch-icon.png"}}">
<link rel="icon" type="image/png" sizes="32x32" href="{{asset "img/favicons/favicon-32x32.png"}}">
<link rel="icon" type="image/png" sizes="16x16" href="{{asset "img/favicons/favicon-16x16.png"}}">
<link rel="shortcut icon" href="{{asset "img/favicons/favicon.ico"}}">
<link rel="manifest" href="{{asset "img/favicons/site.webmanifest"}}">
<link rel="mask-icon" href="{{asset "img/favicons/safari-pinned-tab.svg"}}" color="#59388D">
<meta name="msapplication-TileColor" content="#212121">
<meta name="msapplication-config" content="{{asset "img/favicons/browserconfig.xml"}}">
<title>{{meta_title}}</title>
<link rel="stylesheet" type="text/css" href="{{asset "assets/dist/css/style.css"}}" />
<link href="https://unpkg.com/[email protected]/dist/aos.css" rel="stylesheet">
{{ghost_head}}
</head>
<body class="{{body_class}}">
<input type="checkbox" id="gn-menustate" class="gn-menustate" />
<nav id="globalnav">
<div class="content container">
<a class="brand" href="/">
<span class="name">{{@site.title}}</span>
</a>
<!-- Nav Menu -->
<div class="menu">
<label class="menuicon" for="gn-menustate" aria-hidden="true">
<span class="bread bread-top">
<span class="crust crust-top"></span>
</span>
<span class="bread bread-bottom">
<span class="crust crust-bottom"></span>
</span>
</label>
{{navigation}}
</div>
</div>
</nav>
{{{body}}}
{{> "footer"}}
<script>
let page = 2;
let url_blog = window.location.href.replace("\/#", "/");
let ids = ['p31', 'p32', 'p33', 'p21', 'p22', 'p1']
let max_page = {{ pagination.pages }};
let currentlyLoading = false;
function ready(fn) {
if (document.readyState != 'loading') {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
function loadContent() {
var req = new XMLHttpRequest();
req.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
parser = new DOMParser();
doc = parser.parseFromString(this.responseText, "text/html");
ids.forEach((id) => {
document.getElementById(id).innerHTML += doc.getElementById(id).innerHTML;
})
currentlyLoading = false;
}
};
req.open("GET", url_blog + 'page/' + page, true);
req.send();
page = page + 1;
}
function bottomDistance() {
return Math.max(document.body.offsetHeight - (window.pageYOffset + window.innerHeight), 0);
}
ready(() => {
document.addEventListener('scroll', function () {
if (bottomDistance() < 1000 && !currentlyLoading) {
currentlyLoading = true;
loadContent();
}
})
})
</script>
{{ghost_foot}}
</body>
</html>