clickable headers

This commit is contained in:
zoe 2022-04-13 19:04:38 +02:00
parent 2e52a4843f
commit 2c56b25d22
10 changed files with 207 additions and 108 deletions

View file

@ -0,0 +1,5 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}" class="colorswitch">
<a class="hash-link colorswitch" href="#{{ .Anchor | safeURL }}">
&nbsp;{{ .Text | safeHTML }}
</a>
</h{{ .Level }}>

View file

@ -1,11 +1,10 @@
<!DOCTYPE html>
<html lang="{{ .Lang }}">
{{- partial "head.html" . -}}
<body class="colorswitch">
{{- partial "header.html" . -}}
<div id="content">
{{- block "main" . }}{{- end }}
</div>
{{- partial "footer.html" . -}}
</body>
{{- partial "head.html" . -}}
<body class="colorswitch">
{{- partial "header.html" . -}}
<div id="content">{{- block "main" . }}{{- end }}</div>
{{- partial "footer.html" . -}}
<script src="/js/main.js"></script>
</body>
</html>

View file

@ -1,7 +1,7 @@
{{ define "main" }}
<main>
<article>
<header>
<header class="colorswitch">
<h1 id="title">{{.Title}}</h1>
</header>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
@ -10,9 +10,12 @@
<div id="pagelist">
<!-- Ranges through content/posts/*.md -->
{{ range .Pages }}
<h2>
<a class="colorswitch" href="{{.Permalink}}">{{.Title}}</h2>{{.Description}}<br>{{.WordCount}}</a>
<div id="postlist">
<h2 class="colorswitch posttitle">
<a class="colorswitch" href="{{.Permalink}}">{{.Title}}</h2><div class="postdescription">{{.Description}}<br>{{.WordCount}} words</a>
</div>
{{ end }}
</div>
</div>
</main>
{{ end }}

View file

@ -13,4 +13,3 @@
<label class="togglelabel colorswitch" for="darkmode-toggle" aria-label="darkmode toggle" role="checkbox"></label>
</span>
</footer>
<script src="/js/darkmode.js"></script>