You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Bertrand Delacretaz <bd...@apache.org> on 2017/09/29 08:49:20 UTC
Website ToC considers only h2 and h3
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
Re: Website ToC considers only h2 and h3
Posted by Bertrand Delacretaz <bd...@apache.org>.
On Fri, Sep 29, 2017 at 12:09 PM, Konrad Windszus <ko...@gmx.de> wrote:
> I just pushed the change in https://git-wip-us.apache.org/repos/asf?p=sling-site.git;a=commit;h=9de648ff47e1bb0ad6c8309870fca238097a809f.
Thanks, it's live now.
-Bertrand
Re: Website ToC considers only h2 and h3
Posted by Konrad Windszus <ko...@gmx.de>.
I just pushed the change in https://git-wip-us.apache.org/repos/asf?p=sling-site.git;a=commit;h=9de648ff47e1bb0ad6c8309870fca238097a809f.
> On 29. Sep 2017, at 11:38, Bertrand Delacretaz <bd...@apache.org> wrote:
>
> On Fri, Sep 29, 2017 at 11:30 AM, Konrad Windszus <ko...@gmx.de> wrote:
>> ... Do you want me to propose something or are you planning to migrate the Git repo to gitbox soon?..
>
> If you can implement what you suggest that would be great. A CSS class
> on the main title sounds great.
>
> Commit to https://git-wip-us.apache.org/repos/asf?p=sling-site.git for
> now and when we move to gitbox we'll take care of that.
>
> I'll work on the publishing instructions today but it looks like
> Robert has been able to publish already so the README is not totally
> off ;-)
>
> -Bertrand
Re: Website ToC considers only h2 and h3
Posted by Robert Munteanu <ro...@apache.org>.
On Fri, 2017-09-29 at 11:38 +0200, Bertrand Delacretaz wrote:
> On Fri, Sep 29, 2017 at 11:30 AM, Konrad Windszus <ko...@gmx.de>
> wrote:
> > ... Do you want me to propose something or are you planning to
> > migrate the Git repo to gitbox soon?..
>
> If you can implement what you suggest that would be great. A CSS
> class
> on the main title sounds great.
>
> Commit to https://git-wip-us.apache.org/repos/asf?p=sling-site.git
> for
> now and when we move to gitbox we'll take care of that.
>
> I'll work on the publishing instructions today but it looks like
> Robert has been able to publish already so the README is not totally
> off ;-)
Yup, it's good enough for me :-)
From memory, the steps are something like
$ mvn clean package
$ git checkout asf-site
$ rsync -av target/site/ ./
Robert
Re: Website ToC considers only h2 and h3
Posted by Bertrand Delacretaz <bd...@apache.org>.
On Fri, Sep 29, 2017 at 11:30 AM, Konrad Windszus <ko...@gmx.de> wrote:
>... Do you want me to propose something or are you planning to migrate the Git repo to gitbox soon?..
If you can implement what you suggest that would be great. A CSS class
on the main title sounds great.
Commit to https://git-wip-us.apache.org/repos/asf?p=sling-site.git for
now and when we move to gitbox we'll take care of that.
I'll work on the publishing instructions today but it looks like
Robert has been able to publish already so the README is not totally
off ;-)
-Bertrand
Re: Website ToC considers only h2 and h3
Posted by Konrad Windszus <ko...@gmx.de>.
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 <bd...@apache.org> 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