lxndrblz / anatole

Anatole is a minimalistic two-column theme for Hugo.
https://themes.gohugo.io/themes/anatole/
MIT License
651 stars 363 forks source link

Please create a partial for ToC #380

Closed jaestevan closed 1 year ago

jaestevan commented 1 year ago

Is your feature request related to a problem? Please describe.

Not having a partial for ToC it is impossible to customize the markup on my posts

Describe the solution you'd like

Change single.html file to use a partial template file for .Params.toc, as it's doing with series or related posts.

lxndrblz commented 1 year ago

@jaestevan It is already implemented. You can activate by setting .Params.toc to true.

jaestevan commented 1 year ago

@jaestevan It is already implemented. You can activate by setting .Params.toc to true.

What I mean is at file https://github.com/lxndrblz/anatole/blob/v1.9.0/layouts/_default/single.html, line 45

  {{- if (eq .Params.toc true) -}}
    <h3>Table of Contents</h3>
    {{ .TableOfContents }}

There is no use of a partial template, like for example at line 54

  {{- if isset .Params "series" -}}
    {{- partial "series.html" . -}}

And then there is no option to create a partial template file to customize the ToC output without modifying the theme files. For example to remove or translate this <h3> tag hardcoded in the single.html file.

Hope that helps clarify.

Thanks! JA.

jaestevan commented 1 year ago

@lxndrblz I sent a pull request with a very small change to fix this issue.

I think I also included what I was expecting to be a different PR. Sorry about that, still new with GitHub. Still I think this second change is also simple but useful.

Thanks, JA.

lxndrblz commented 1 year ago

@jaestevan Hi there, I've opened a separate PR for your other adjustment. Please only do one topic at a time.