From 8e541f28dd941abc8ff1512e7543713877aeb5bf Mon Sep 17 00:00:00 2001 From: Neil Brommer Date: Wed, 12 Jul 2023 15:28:16 -0700 Subject: [PATCH] Add styling for table of contents --- eleventy.config.js | 4 +++- src/css/Components/_table-of-contents.scss | 10 ++++++++++ src/css/site.scss | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/css/Components/_table-of-contents.scss diff --git a/eleventy.config.js b/eleventy.config.js index f680196..04325ea 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -28,7 +28,9 @@ module.exports = function (eleventyConfig) { }); eleventyConfig.amendLibrary("md", mdLib => mdLib .use(mdDefList) - .use(mdToc) + .use(mdToc, { + includeLevel: [ 1, 2, 3, 4, 5, 6 ] + }) .use(mdAnchor)); eleventyConfig.addFilter("IsNotPage", (collection, url) => diff --git a/src/css/Components/_table-of-contents.scss b/src/css/Components/_table-of-contents.scss new file mode 100644 index 0000000..540247d --- /dev/null +++ b/src/css/Components/_table-of-contents.scss @@ -0,0 +1,10 @@ +@use '_variables'; + +.table-of-contents { + padding-left: 0.5em; + padding-right: 1em; + border: 1px solid var(--primary-border-color); + border-radius: var(--main-border-radius); + + text-transform: capitalize; +} diff --git a/src/css/site.scss b/src/css/site.scss index fdfd2bb..882e465 100644 --- a/src/css/site.scss +++ b/src/css/site.scss @@ -12,3 +12,4 @@ @use 'Components/_lists'; @use 'Components/_code'; @use 'Components/_posts'; +@use 'Components/_table-of-contents';