Skip to content

Consider using explicit markup for each section to avoid numbering-related classes #5

@hubgit

Description

@hubgit

If the template wraps each section explicitly in a <section> tag, and uses h1, h2, etc + section > section > … to indicate the depth of nesting, then it's possible to avoid all the .counter-skip classes by only applying the numbering to headings inside section elements.

Here's an example: master...hubgit:explicit-sections

The article layout basically looks like this:

<article>
  <header>
    <h1>Article Title</h1>
    <div></div>
  </header>

  <section>
    <h2>Section heading</h2>
    <p></p>
  </section>

  <section>
    <h2>Section heading</h2>
    <p></p>

    <section>
      <h3>Subsection heading</h3>
      <p></p>
    </section>

    <section>
      <h3>Subsection heading</h3>
      <p></p>
    </section>
  </section>

  <footer>
    <div></div>
  </footer>
</article>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions