Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/LukasJoswiak/etch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Joswiak <lukas@lukasjoswiak.com>2020-06-08 06:40:45 +0300
committerGitHub <noreply@github.com>2020-06-08 06:40:45 +0300
commite7a40d5305f980de8fd560d0b8196fdbd362ee5e (patch)
tree5520aabf8d44b2f96918dabd4499d0302ddcbe4c
parentf8e5ca54ec2b566900dfb461c22425be5e3ea625 (diff)
Add table of contents shortcode (#3)
-rw-r--r--assets/css/dark.css4
-rw-r--r--exampleSite/config.toml3
-rw-r--r--layouts/shortcodes/toc.html4
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>