Closed kauesena closed 2 years ago
I'd like to add my thanks for this excellent theme. Besides I tested adding that code to the analogous file to another project using Eureka theme and the expected result was obtained.
I tried following this post, but things do not work out well following it either. (There is some content in the comments section.) https://codingnconcepts.com/hugo/auto-number-headings-hugo/
I don't have an answer to this problem. I will try testing your changes later.
Edit: this was only an apparent fix.
I managed to obtain the correct numbering, but I would not be able to explain why it works. In the file assets/scss/_base.scss
, I've head to add to the first body { }
the line:
counter-reset: h1 h2 h3 h4 h5 h6;
Then, to h1 { }
the line
counter-reset: h2;
and analogously with hn{ }
to each h(n+1)
until n=5. Having done those modifications, the snippets
article h2::before {
content: counter(h2counter) ".";
counter-increment: h2counter;
counter-reset: h3counter;
}
have the desired effect.
I decided to do that observing this file https://github.com/rougier/homepage/blob/master/python-opengl/book.css
It was only an apparent fix, probably due to havin created another hugo site for testing. When the numbering bug takes effect, going to the another site project and running hugo server
, canceling and then running back the first site, makes the numbering correct again.
I think adding
to
hugo-coder/assets/scss/_base.scss
should give sectioning likebut what it gives me is:
I do not know if that is indeed a bug. But I would also like to suggest the implementation of an option to be set in the frontmatter of each article to decide if that article should have section numbers or not.