git: f1bddf0efa - main - doc: fix HTML validation errors

From: Vladlen Popolitov <vladlen_at_FreeBSD.org>
Date: Sat, 26 Sep 2026 10:34:56 UTC
The branch main has been updated by vladlen:

URL: https://cgit.FreeBSD.org/doc/commit/?id=f1bddf0efa310197c7340aff9128cb4c57cbee30

commit f1bddf0efa310197c7340aff9128cb4c57cbee30
Author:     Vladlen Popolitov <vladlen@FreeBSD.org>
AuthorDate: 2026-09-26 10:34:49 +0000
Commit:     Vladlen Popolitov <vladlen@FreeBSD.org>
CommitDate: 2026-09-26 10:34:49 +0000

    doc: fix HTML validation errors
    
    Fix duplicate id and invalid heading levels in TOC
    
    Replace h3 with p.toc-title to fix heading-level validation errors,
    rename mobile TOC id to TableOfContentsMobile to avoid duplicate ids,
    and restore original h3 sizing via --size-550.
    
    Reviewed by: carlavilla
    Approved by: carlavilla
    Differential Revision: https://reviews.freebsd.org/D60037
    PR: 297509
---
 .../beastie/assets/styles/documentation.scss       | 23 ++++++++++++++++++----
 .../themes/beastie/layouts/articles/list.html      |  8 ++++----
 .../themes/beastie/layouts/articles/single.html    |  8 ++++----
 .../themes/beastie/layouts/books/list.html         |  8 ++++----
 .../themes/beastie/layouts/books/single.html       |  8 ++++----
 5 files changed, 35 insertions(+), 20 deletions(-)

diff --git a/documentation/themes/beastie/assets/styles/documentation.scss b/documentation/themes/beastie/assets/styles/documentation.scss
index 0c0ba1d2a4..3b49bc26da 100644
--- a/documentation/themes/beastie/assets/styles/documentation.scss
+++ b/documentation/themes/beastie/assets/styles/documentation.scss
@@ -254,9 +254,14 @@
     overflow-y: auto;
     transition: .2s ease-in-out;
 
-    h3 {
+    .toc-title {
       border-bottom: none;
       margin: 1rem 0;
+      font-size: var(--size-550);
+      font-weight: bold;
+      padding-top: .8rem;        
+      padding-bottom: .3rem;
+      line-height: 1.3;
     }
 
     #TableOfContents {
@@ -290,8 +295,13 @@
     }
 
     .resources {
-      h3 {
+      .resources-title {
         margin: 1rem 0;
+        font-size: var(--size-550);
+        font-weight: bold;
+        padding-top: .8rem;        
+        padding-bottom: .3rem;
+    line-height: 1.3;
       }
 
       ul {
@@ -319,11 +329,16 @@
 }
 
 .toc-mobile {
-  h3 {
+  .toc-title {
     border-bottom: none;
+    font-size: var(--size-550);
+    font-weight: bold;
+    padding-top: .8rem;        
+    padding-bottom: .3rem;
+    line-height: 1.3;
   }
 
-  #TableOfContents, .resources {
+  #TableOfContentsMobile, .resources {
     ul {
       list-style: none;
       margin: 0;
diff --git a/documentation/themes/beastie/layouts/articles/list.html b/documentation/themes/beastie/layouts/articles/list.html
index 5c3029352f..7c9cddd7d9 100644
--- a/documentation/themes/beastie/layouts/articles/list.html
+++ b/documentation/themes/beastie/layouts/articles/list.html
@@ -23,8 +23,8 @@
       {{ partial "trademarks" .Params.trademarks }}
     {{ end }}
     <div class="toc-mobile">
-      <h3>{{ i18n "toc" }}</h3>
-      {{ .TableOfContents }}
+      <p class="toc-title" id="toc-mobile-title">{{ i18n "toc" }}</p>
+      {{ .TableOfContents | replaceRE "id=\"TableOfContents\"" "id=\"TableOfContentsMobile\"" | safeHTML }}
     </div>
     {{ .Content }}
     {{ if .GitInfo }}
@@ -36,11 +36,11 @@
   </div>
   <aside class="toc">
     <div class="toc-content">
-      <h3>{{ i18n "toc" }}</h3>
+      <p class="toc-title" id="toc-sidebar-title">{{ i18n "toc" }}</p>
       {{ .TableOfContents }}
       <hr />
       <div class="resources">
-        <h3>{{ i18n "resources" }}</h3>
+        <p class="resources-title" id="toc-resources-title">{{ i18n "resources" }}</p>
         <ul class="contents">
           {{ $pathSections := split .Page.Path "/" }}
           {{ $docLang := $.Site.Home.Language.Lang }}
diff --git a/documentation/themes/beastie/layouts/articles/single.html b/documentation/themes/beastie/layouts/articles/single.html
index 14120e6b90..88ebbe4443 100644
--- a/documentation/themes/beastie/layouts/articles/single.html
+++ b/documentation/themes/beastie/layouts/articles/single.html
@@ -23,8 +23,8 @@
       {{ partial "trademarks" .Params.trademarks }}
     {{ end }}
     <div class="toc-mobile">
-      <h3>{{ i18n "toc" }}</h3>
-      {{ .TableOfContents }}
+      <p class="toc-title" id="toc-mobile-title">{{ i18n "toc" }}</p>
+      {{ .TableOfContents | replaceRE "id=\"TableOfContents\"" "id=\"TableOfContentsMobile\"" | safeHTML }}
     </div>
     {{ .Content }}
     {{ if .GitInfo }}
@@ -36,11 +36,11 @@
   </div>
   <aside class="toc">
     <div class="toc-content">
-      <h3>{{ i18n "toc" }}</h3>
+      <p class="toc-title" id="toc-sidebar-title">{{ i18n "toc" }}</p>
       {{ .TableOfContents }}
       <hr />
       <div class="resources">
-        <h3>{{ i18n "resources" }}</h3>
+        <p class="resources-title" id="toc-resources-title">{{ i18n "resources" }}</p>
         <ul class="contents">
           {{ $pathSections := split .Page.Path "/" }}
           {{ $docLang := $.Site.Home.Language.Lang }}
diff --git a/documentation/themes/beastie/layouts/books/list.html b/documentation/themes/beastie/layouts/books/list.html
index dc6a7f63e5..1ae8667b7c 100644
--- a/documentation/themes/beastie/layouts/books/list.html
+++ b/documentation/themes/beastie/layouts/books/list.html
@@ -42,8 +42,8 @@
       {{ partial "trademarks" .Params.trademarks }}
     {{ end }}
     <div class="toc-mobile">
-      <h3>{{ i18n "toc" }}</h3>
-      {{ .TableOfContents }}
+      <p class="toc-title" id="toc-mobile-title">{{ i18n "toc" }}</p>
+      {{ .TableOfContents | replaceRE "id=\"TableOfContents\"" "id=\"TableOfContentsMobile\"" | safeHTML }}
     </div>
     {{ if $.Site.Params.isOnline }}
       {{ if .Params.add_split_page_link }}
@@ -123,11 +123,11 @@
   </div>
   <aside class="toc">
     <div class="toc-content">
-      <h3>{{ i18n "toc" }}</h3>
+      <p class="toc-title" id="toc-sidebar-title">{{ i18n "toc" }}</p>
       {{ .TableOfContents }}
       <hr />
       <div class="resources">
-        <h3>{{ i18n "resources" }}</h3>
+        <p class="resources-title" id="toc-resources-title">{{ i18n "resources" }}</p>
         <ul class="contents">
           {{ $pathSections := split .Page.Path "/" }}
           {{ $docLang := $.Site.Home.Language.Lang }}
diff --git a/documentation/themes/beastie/layouts/books/single.html b/documentation/themes/beastie/layouts/books/single.html
index 332b00d4d7..0185cf2471 100644
--- a/documentation/themes/beastie/layouts/books/single.html
+++ b/documentation/themes/beastie/layouts/books/single.html
@@ -42,8 +42,8 @@
       {{ partial "trademarks" .Params.trademarks }}
     {{ end }}
     <div class="toc-mobile">
-      <h3>{{ i18n "toc" }}</h3>
-      {{ .TableOfContents }}
+      <p class="toc-title" id="toc-mobile-title">{{ i18n "toc" }}</p>
+      {{ .TableOfContents | replaceRE "id=\"TableOfContents\"" "id=\"TableOfContentsMobile\"" | safeHTML }}
     </div>
     {{ if $.Site.Params.isOnline }}
       {{ if .Params.add_split_page_link }}
@@ -123,11 +123,11 @@
   </div>
   <aside class="toc">
     <div class="toc-content">
-      <h3>{{ i18n "toc" }}</h3>
+      <p class="toc-title" id="toc-sidebar-title">{{ i18n "toc" }}</p>
       {{ .TableOfContents }}
       <hr />
       <div class="resources">
-        <h3>{{ i18n "resources" }}</h3>
+        <p class="resources-title" id="toc-resources-title">{{ i18n "resources" }}</p>
         <ul class="contents">
           {{ $pathSections := split .Page.Path "/" }}
           {{ $docLang := $.Site.Home.Language.Lang }}