-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfooter.html
124 lines (102 loc) · 3.76 KB
/
footer.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
<footer>
<p style="float:right;margin:0 1rem;">
© {{ now.Format "2006" }} <a href="https://github.com/{{.Site.Params.github}}">{{ .Site.Params.author }}.</a>
<!-- Powered by <a href="https://gohugo.io/" target="_blank">Hugo</a> using the <a href="https://github.com/arjunkrishnababu96/basics" target="_blank">Basics</a> theme. -->
</p>
<hr>
{{if eq .Params.labels false }}
{{else if or (.Site.Params.labels) (.Params.labels) }}
<ul class="tags" style="float: left!important;">
{{ if .Params.tags }}
<span>标签:</span>
{{ range .Params.tags }}<li><a class="link" href="{{$.Site.BaseURL}}tags/{{ . }}"> #{{ . }} </a></li>{{ end }}
{{ end }}
<span> </span>
{{ if .Params.categories }}
<span>分类:</span>
{{ range .Params.categories }}<li><a class="link" href="{{$.Site.BaseURL}}categories/{{ . }}"> #{{ . }} </a></li>{{ end }}
{{ end }}
</ul>
{{ end }}
<br>
</footer>
</div> <!-- closes the outer/inner div -->
<!-- load bootstrap JS -->
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.3.1/jquery.slim.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.1.1/js/bootstrap.min.js"></script>
{{ with .Site.Params.googleAnalytics }}
{{ "<!-- Global site tag (gtag.js) - Google Analytics -->" | safeHTML }}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', '{{ . }}');
</script>
{{ end }}
<!-- series Posts -->
{{ if .IsHome }}
<script>
(function(){
var seriesA = document.getElementsByTagName("a");
seriesA = Array.from(seriesA).filter(x =>x.getAttribute("data-series"));
var nameSeries = {}
if(seriesA.length){
seriesA.forEach(x =>{
var xdata = x.getAttribute("data-series")
if(nameSeries[xdata]){
nameSeries[xdata].push(x)
}else{
nameSeries[xdata] = [x]
}
})
}
function createE(){
var detailsArr = [] // full html
var postPosArr = [] // outerHTML
for(let i in nameSeries){
var dcreateE = document.createElement("details")
var screateE = document.createElement("summary")
screateE.style.display = "list-item" // fix: summary without ::marker in firefox
screateE.innerHTML = `系列:<span style="color: #777;"> ${i} </span>` +
`<span style="border-radius: 29%;border: 2px dashed #fe16fe;padding:3px;">No.${nameSeries[i].length}</span> ` +
`最新:<span style="color: #428bca;">${nameSeries[i][0].text} </span>`;
var inner = screateE.outerHTML // details innerHTML
nameSeries[i].forEach(x =>{
inner += x.outerHTML
x.parentElement.style.display = "none"
})
postPosArr.push(nameSeries[i][0])
dcreateE.innerHTML = inner
detailsArr.push(dcreateE)
}
console.info(postPosArr)
console.log(detailsArr[0])
postPosArr.forEach(a =>{
a.parentElement.style.display = "block"
a.outerHTML = detailsArr.shift().outerHTML
})
}
createE()
})()
</script>
{{else}}
{{if eq .Params.imagezoom false }}
{{else if or (.Site.Params.imageZoom) (.Params.imagezoom) }}
<script src="https://cdn.jsdelivr.net/npm/medium-zoom@1.0.4/dist/medium-zoom.min.js"></script>
<script>
const zoom = mediumZoom()
zoom.attach("p img")
</script>
{{end}}
<!-- // START - Edit Button -->
{{if .Site.Params.githubRepo}}
<script>
document.getElementById("edit-button").addEventListener("click", function () {
var editWindow = window.open("{{ .Site.Params.githubRepo }}/edit/master/content/{{ with .File }}{{ .Path }}{{ end }}");
});</script>
{{ end }}
<!-- // END - Edit Button -->
{{ end }}
</body>
</html>