Add styling for table of contents

This commit is contained in:
Neil Brommer 2023-07-12 15:28:16 -07:00
parent f1c6ac09c8
commit 8e541f28dd
3 changed files with 14 additions and 1 deletions

View file

@ -28,7 +28,9 @@ module.exports = function (eleventyConfig) {
}); });
eleventyConfig.amendLibrary("md", mdLib => mdLib eleventyConfig.amendLibrary("md", mdLib => mdLib
.use(mdDefList) .use(mdDefList)
.use(mdToc) .use(mdToc, {
includeLevel: [ 1, 2, 3, 4, 5, 6 ]
})
.use(mdAnchor)); .use(mdAnchor));
eleventyConfig.addFilter("IsNotPage", (collection, url) => eleventyConfig.addFilter("IsNotPage", (collection, url) =>

View file

@ -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;
}

View file

@ -12,3 +12,4 @@
@use 'Components/_lists'; @use 'Components/_lists';
@use 'Components/_code'; @use 'Components/_code';
@use 'Components/_posts'; @use 'Components/_posts';
@use 'Components/_table-of-contents';