Page MenuHomeFreeBSD

Fix HTML validation error on article pages with subtitle
ClosedPublic

Authored by vladlen on Sun, Sep 27, 11:37 AM.

Details

Summary

Problem

Pages with a subtitle in front matter (f.e. article/fonts) fail W3C validation:
the template renders <h3 class="subtitle"> immediately after
<h1>, skipping <h2>. This also makes screen readers announce
the subtitle as a level-3 heading, which it is not.

Changes

  • layouts/articles/list.html and single.html: render subtitle as <p class="subtitle"> instead of <h3 class="subtitle">.
  • documentation.scss: add .subtitle styles (size, weight, italic, muted color, margins) to preserve the existing look. Subtitle does not have horizontal line now as it is not header now, but it is easy to add in style.

Rationale

subtitle is part of the title block (alongside title, authors,
copyright, trademarks), not a section heading. It should not
participate in the document heading hierarchy. Visual appearance is
now controlled via CSS instead of borrowing <h3> defaults.

Diff Detail

Repository
R9 FreeBSD doc repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

vladlen created this revision.
This revision is now accepted and ready to land.Sun, Sep 27, 11:41 AM