diff options
author | Lukas Joswiak <lukas@lukasjoswiak.com> | 2020-06-08 06:40:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-08 06:40:45 +0300 |
commit | e7a40d5305f980de8fd560d0b8196fdbd362ee5e (patch) | |
tree | 5520aabf8d44b2f96918dabd4499d0302ddcbe4c | |
parent | f8e5ca54ec2b566900dfb461c22425be5e3ea625 (diff) |
Add table of contents shortcode (#3)
-rw-r--r-- | assets/css/dark.css | 4 | ||||
-rw-r--r-- | exampleSite/config.toml | 3 | ||||
-rw-r--r-- | layouts/shortcodes/toc.html | 4 |
3 files changed, 11 insertions, 0 deletions
diff --git a/assets/css/dark.css b/assets/css/dark.css index 5c71e9c..07b6810 100644 --- a/assets/css/dark.css +++ b/assets/css/dark.css @@ -23,6 +23,10 @@ main#content p { color: #f5f5f5; } +main#content #toc h4 { + color: #d4d4d4; +} + main#content ul#posts small { color: #a7a7a7; } diff --git a/exampleSite/config.toml b/exampleSite/config.toml index c2050d3..72d9c45 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -18,3 +18,6 @@ pygmentsUseClasses = true [markup.goldmark.renderer] # Allow HTML in Markdown unsafe = true + + [markup.tableOfContents] + ordered = true diff --git a/layouts/shortcodes/toc.html b/layouts/shortcodes/toc.html new file mode 100644 index 0000000..22da6e7 --- /dev/null +++ b/layouts/shortcodes/toc.html @@ -0,0 +1,4 @@ +<aside id="toc"> + <h4>Table of Contents</h4> + {{ .Page.TableOfContents }} +</aside> |