blob: c69a7a39b5586dd3b5ef963c41fc4e5be55d54c9 (
plain)
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
|
{{ block "customphp" . }}{{ end }}
<!DOCTYPE html>
<html lang="{{ .Site.Language }}">
<head>
{{ partial "head.html" . }}
{{ block "customseo" . }}{{ end }}
{{ with .Params.customheader }}
{{ . | safeHTML }}
{{ end }}
</head>
<body class="w3-light-grey">
<header id="header">
{{ block "customheader" . }}
{{ partial "header.html" . }}
{{ end }}
</header>
<div class="w3-content">
<div>
<div id="content" >
{{ block "main" . }}{{ end }}
</div>
{{ if .Site.Params.socialshare }}
{{ partial "socialshare.html" . }}
{{ end }}
{{ block "commentornotes" . }}
{{ partial "comments.html" . }}
{{ end }}
</div>
<footer id="footer" >
{{ partial "footer.html" . }}
</footer>
</div>
<!-- Back to top -->
{{ if .Site.Params.backtotop }}
<div id="backtotop" class="w3-hide-small w3-hide-medium">
<button onclick="topFunction()" class="w3-btn w3-red w3-large" style="width:160px">{{ T "backtotop"}}
→</button>
</div>
<script>
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script>
{{ end }}
<!-- scroll indicator -->
{{ if .Site.Params.scrollindicator }}
<div class="progress-container" id="scrollbar">
<div class="progress-bar" id="progress-bar"></div>
</div>
{{ end }}
<script>
// When the user scrolls down 50px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
<!-- TOC -->
{{ if and (ge (len .TableOfContents) 100) (ne .Params.toc "false") }}
if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
document.getElementById("toc").style.display = "block";
} else {
document.getElementById("toc").style.display = "none";
}
{{ end }}
<!-- Back to top -->
{{ if .Site.Params.backtotop }}
if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
document.getElementById("backtotop").style.display = "block";
} else {
document.getElementById("backtotop").style.display = "none";
}
{{ end }}
<!-- scroll indicator -->
{{ if .Site.Params.scrollindicator }}
var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
var scrolled = (winScroll / height) * 100;
document.getElementById("progress-bar").style.width = scrolled + "%";
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("scrollbar").style.display = "block";
} else {
document.getElementById("scrollbar").style.display = "none";
}
{{ end }}
}
</script>
{{ with .Params.customfooter }}
{{ . | safeHTML }}
{{ end }}
</body>
</html>
|