-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfooter.html
More file actions
46 lines (40 loc) · 1.44 KB
/
footer.html
File metadata and controls
46 lines (40 loc) · 1.44 KB
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
<footer class="footer">
<ul class="footer-links">
{{ with .OutputFormats.Get "RSS" }}
<li>
<a href="{{ .RelPermalink }}" type="application/rss+xml" target="_blank">RSS feed</a>
</li>
{{ end }}
<li>
<a href="https://gohugo.io/" class="footer-links-kudos">Made with <img src="/images/hugo-logo.png" width="22" height="22" alt="hugo"></a>
</li>
</ul>
</footer>
</div>
{{ template "_internal/google_analytics.html" . }}
<!-- link rel="stylesheet" href="{{ .Site.BaseURL }}css/fonts.css" / -->
<script>
/* apparently it's impossible to customize the html code hugo generates for headings..
* I want to make it easy to get a link to them (which itself is possible, hugo
* automatically sets ids for headings that can be used as anchors),
* so this bit of JS prepends a clickable "# " to the heading, using the
* id as the link target. */
for(h=1; h<=6; ++h) // for <h1>, <h2>, ..., <h6>
{
var hs = document.getElementsByTagName('h'+h);
for(i=0; i<hs.length; ++i)
{
// if the heading has an id, it can be linked to => add "# " link to heading
if(hs[i].id)
{
var l = document.createElement("a");
l.href = "#" + hs[i].id;
l.innerHTML = "# ";
l.className = "headinglink";
hs[i].insertBefore(l, hs[i].firstChild);
}
}
}
</script>
</body>
</html>