Skip to content

Posts title levels should be shifted at rendering time #49

@gasche

Description

@gasche

If you use # to mark sections in your blog posts and ## for subsections, they get translated literally to <h1> and <h2>, which is bad as the sections then conflict with the level of the blog post title. Currently the workaround is to manually increment the headings in the blog post, but I think that it would be nicer if the blog engine shifted the headings level accordingly (when I write a post, I think of the headings level locally for the post, I don't have the whole site architecture in mind).

In fact, I realize now that using <h1> for the post title also conflicts with the "Inside PRL" header that is, as it should, a <h1> heading itself. So the post title should be <h2>, and the sections <h3>. This supports the argument that post authors cannot know in advance how much to shift their headings, so it should be done at post rendering time.

Having this feature would require modifying Frog itself. If we do modify Frog, we have to think of a transition strategy for old posts (are there shifted, and they should be de-shifted, or do they suffer from the same issue?). Or we could make it an option at the Frog level, so that blog posts could opt in or out of heading translation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions