Skip to content

Commit fe4b8b3

Browse files
committed
feat: allow removing TOC via frontmatter parameter
1 parent 0df9d06 commit fe4b8b3

File tree

6 files changed

+43
-15
lines changed

6 files changed

+43
-15
lines changed

.config/dictionaries/names.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Brzozowski
2+
Hasicorp
23
Jaden
34
Kalt
45
Leemis

.shellcheckrc

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
external-sources=true
22
source-path=SCRIPTDIR
3+
disable=SC2002
4+
# ^ ignore useless cat

.vscode/settings.json

+21-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"editor.formatOnSave": true,
2+
"editor.formatOnSave": false,
33
"evenBetterToml.formatter.reorderKeys": true,
44
"evenBetterToml.formatter.reorderArrays": true,
55
"evenBetterToml.formatter.indentTables": true,
@@ -11,5 +11,24 @@
1111
"evenBetterToml.formatter.alignComments": true,
1212
"[toml]": {
1313
"editor.defaultFormatter": "tamasfe.even-better-toml"
14-
}
14+
},
15+
"[html]": {
16+
"editor.formatOnPaste": false
17+
},
18+
"[markdown]": {
19+
"editor.formatOnSave": true,
20+
"editor.unicodeHighlight.ambiguousCharacters": false,
21+
"editor.unicodeHighlight.invisibleCharacters": false,
22+
"diffEditor.ignoreTrimWhitespace": false,
23+
"editor.wordWrap": "on",
24+
"editor.quickSuggestions": {
25+
"comments": "off",
26+
"strings": "off",
27+
"other": "off"
28+
},
29+
"cSpell.fixSpellingWithRenameProvider": true,
30+
"cSpell.advanced.feature.useReferenceProviderWithRename": true,
31+
"cSpell.advanced.feature.useReferenceProviderRemove": "/^#+\\s/"
32+
},
33+
"workbench.colorTheme": "Quiet Light"
1534
}

flake.lock

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
hugo
2424
lychee
2525
shellcheck
26+
pagefind
2627
];
2728
};
2829
}

layouts/posts/single.html

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
{{ define "main" }}
2-
<main>
3-
<h1> {{ .Title }} </h1>
4-
5-
<span class="bg-info">Published on <time>{{ .Date | time.Format "2006-01-02" }}</time></span>
2+
<main>
3+
<h1> {{ .Title }} </h1>
64

5+
<span class="bg-info">Published on <time>{{ .Date | time.Format "2006-01-02" }}</time></span>
6+
7+
{{ if isset .Params "toc" }}
8+
{{ if .Params.toc }}
9+
{{ .TableOfContents }}
10+
{{ end }}
11+
{{ else }}
712
{{ .TableOfContents }}
8-
9-
{{ .Content }}
10-
</main>
13+
{{ end }}
14+
{{ .Content }}
15+
</main>
1116
{{ end }}

0 commit comments

Comments
 (0)