mirror of
https://git.kittycat.homes/zoe/hugo-battheme.git
synced 2024-08-15 03:25:18 +00:00
clickable headers
This commit is contained in:
parent
2e52a4843f
commit
2c56b25d22
10 changed files with 207 additions and 108 deletions
5
layouts/_default/_markup/render-heading.html
Normal file
5
layouts/_default/_markup/render-heading.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
<h{{ .Level }} id="{{ .Anchor | safeURL }}" class="colorswitch">
|
||||
<a class="hash-link colorswitch" href="#{{ .Anchor | safeURL }}">
|
||||
{{ .Text | safeHTML }}
|
||||
</a>
|
||||
</h{{ .Level }}>
|
|
@ -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>
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue