From 1147a663e70aadb2578cbe601bc723d7cd939c5a Mon Sep 17 00:00:00 2001 From: aethrvmn Date: Sat, 30 Aug 2025 15:17:32 +0200 Subject: added non-content --- themes/hugo-book/assets/plugins/_numbered.scss | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 themes/hugo-book/assets/plugins/_numbered.scss (limited to 'themes/hugo-book/assets/plugins/_numbered.scss') diff --git a/themes/hugo-book/assets/plugins/_numbered.scss b/themes/hugo-book/assets/plugins/_numbered.scss new file mode 100644 index 0000000..d7ad4d5 --- /dev/null +++ b/themes/hugo-book/assets/plugins/_numbered.scss @@ -0,0 +1,34 @@ +$startLevel: 1; +$endLevel: 6; + +.book-page .markdown.book-article { + @for $currentLevel from $startLevel through $endLevel { + h#{$currentLevel} { + counter-increment: h#{$currentLevel}; + counter-reset: h#{$currentLevel + 1}; + + $content: ""; + @for $n from $startLevel through $currentLevel { + $content: $content + 'counter(h#{$n})"."'; + } + + &::before { + content: unquote($content) " "; + } + } + } +} + +.book-toc nav#TableOfContents ul { + counter-reset: item; + + li { + counter-increment: item; + + &:before { + content: counters(item, ".") ". "; + float: left; + margin-inline-end: $padding-4; + } + } +} -- cgit v1.2.3