Currently the MD files either start the explicit headlines with an h1 
(https://github.com/apache/sling-site/blob/master/src/main/jbake/content/documentation/development/jsr-305.md)
 or with an h2 (e.g. 
https://github.com/apache/sling-site/blob/master/src/main/jbake/content/documentation/development.md).
To correctly list both variants in the TOC I would recommend to only list the 
h1's which are not a title. For that we could either render the title with a 
dedicated class and then come up with a selector which includes h1, h2 and h3 
(without that specific class). That way the TOC would look correct for all 
variants I think.
If you don't want to introduce a special class for rendering the title we could 
also come up with a selector to select the a tag below an h1/h2/h3 tag.
Another solution would be to not render the title at all as headline but rather 
only in the title tag of the head section...

Do you want me to propose something or are you planning to migrate the Git repo 
to gitbox soon?
Thanks,
Konrad

> On 29. Sep 2017, at 10:49, Bertrand Delacretaz <[email protected]> wrote:
> 
> Hi,
> 
> Konrad Windszus wrote:
>> What is the reason why the selector at
>> https://github.com/apache/sling-site/blob/f7d38e20d4576a37413fb3d31a28060e8dc0ac60/src/main/jbake/templates/page.tpl#L49
>> only lists h2 and h3?
> 
> Omitting h1 avoids duplicating the page title in the ToC, and stopping
> at h3 prevents the ToC from becoming too detailed.
> 
> I think this works well, taking this page as an example:
> http://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html
> 
> But I'm open to different views of course, what would you do differently?
> 
> -Bertrand

Reply via email to