toc-autonumbering
borrowed from https://codingnconcepts.com/hugo/auto-number-headings-hugo/
This commit is contained in:
@@ -32,6 +32,7 @@ body {
|
||||
.headings--one-size {
|
||||
h1,
|
||||
h2,
|
||||
.toc-title,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
@@ -45,6 +46,7 @@ body {
|
||||
|
||||
h1,
|
||||
h2,
|
||||
.toc-title,
|
||||
h3 {
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
|
||||
@@ -126,3 +126,17 @@ h1:hover a, h2:hover a, h3:hover a, h4:hover a {
|
||||
.footnotes {
|
||||
color: transparentize($color, .5);
|
||||
}
|
||||
|
||||
/* Auto Numbering */
|
||||
// https://codingnconcepts.com/hugo/auto-number-headings-hugo/
|
||||
body {counter-reset: h2}
|
||||
h2 {counter-reset: h3}
|
||||
h3 {counter-reset: h4}
|
||||
h4 {counter-reset: h5}
|
||||
|
||||
article[autonumbering] h2:before {counter-increment: h2; content: counter(h2) " "}
|
||||
article[autonumbering] h3:before {counter-increment: h3; content: counter(h2) "." counter(h3) " "}
|
||||
article[autonumbering] h4:before {counter-increment: h4; content: counter(h2) "." counter(h3) "." counter(h4) " "}
|
||||
|
||||
article[autonumbering] .table-of-contents ul { counter-reset: item }
|
||||
article[autonumbering] .table-of-contents li a:before { content: counters(item, ".") " "; counter-increment: item }
|
||||
|
||||
Reference in New Issue
Block a user