From 046e9276bb15d16ed4c7eab1b6cec0198fc2d122 Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Wed, 7 Oct 2026 07:49:01 -0500 Subject: [PATCH 1/6] Match the documentation breadcrumb line to the board's breadcrumb size Co-Authored-By: Claude Opus 5.5 --- styles/all/theme/documentation.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/styles/all/theme/documentation.css b/styles/all/theme/documentation.css index f37532c..cc60137 100644 --- a/styles/all/theme/documentation.css +++ b/styles/all/theme/documentation.css @@ -5,6 +5,8 @@ flex-wrap: wrap; gap: 10px; margin-bottom: 10px; + /* Same size as the board's own breadcrumbs (prosilver's ul.linklist > li). */ + font-size: 1.1em; } .documentation-language-picker a { From 10dc08e65c7a070c26c210cb72a57f3a06a83ca7 Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Wed, 7 Oct 2026 07:52:19 -0500 Subject: [PATCH 2/6] Bold the breadcrumb and use the board's home icon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The documentation breadcrumb is bold like the board's own, and the extension replaces the small ⌂ character Hugo puts before the home link with the Font Awesome home icon the board's breadcrumb uses. Co-Authored-By: Claude Opus 5.5 --- controller/documentation_helper.php | 28 +++++++++++++++++++ styles/all/theme/documentation.css | 5 ++++ .../controller/documentation_helper_test.php | 7 +++-- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/controller/documentation_helper.php b/controller/documentation_helper.php index 84a7cb7..733e216 100644 --- a/controller/documentation_helper.php +++ b/controller/documentation_helper.php @@ -24,6 +24,9 @@ class documentation_helper { const COOKIE_NAME = 'phpbb_docs_lang'; + /** Character Hugo's breadcrumb puts before its home link. */ + const HUGO_HOME_GLYPH = '⌂'; + /** * The one top-level section name the developer docs build produces * (see phpbbdocs_hugo_devdocs.sh) — the sole boundary between @@ -858,6 +861,7 @@ protected function extract_fragments($file, $lang, $path, array $allowed_section { $switcher->parentNode->removeChild($switcher); } + $this->use_board_home_icon($breadcrumb_node); $this->rewrite_absolute_links($breadcrumb_node); } $this->process_images($article_node, $lang, $path); @@ -871,6 +875,30 @@ protected function extract_fragments($file, $lang, $path, array $allowed_section ); } + /** + * Replaces the "⌂" character Hugo puts before the breadcrumb's home + * link with the Font Awesome home icon the board's own breadcrumb + * uses, so both lines look the same. + * + * @param \DOMNode $breadcrumb_node + * @return void + */ + protected function use_board_home_icon(\DOMNode $breadcrumb_node) + { + $xpath = new \DOMXPath($breadcrumb_node->ownerDocument); + $text = $xpath->query('.//a[1]/text()[1]', $breadcrumb_node)->item(0); + if ($text === null || strpos(ltrim($text->nodeValue), self::HUGO_HOME_GLYPH) !== 0) + { + return; + } + + $text->nodeValue = ltrim(substr(ltrim($text->nodeValue), strlen(self::HUGO_HOME_GLYPH))); + $icon = $breadcrumb_node->ownerDocument->createElement('i'); + $icon->setAttribute('class', 'icon fa-home fa-fw'); + $icon->setAttribute('aria-hidden', 'true'); + $text->parentNode->insertBefore($icon, $text); + } + /** * Removes .docs-tree-section blocks the current user isn't allowed to * see, identified by the section segment of each section link's diff --git a/styles/all/theme/documentation.css b/styles/all/theme/documentation.css index cc60137..f140ecd 100644 --- a/styles/all/theme/documentation.css +++ b/styles/all/theme/documentation.css @@ -9,6 +9,11 @@ font-size: 1.1em; } +/* Bold like the board's breadcrumb links; the language picker keeps bold for the current language only. */ +.documentation-breadcrumb .utility-bar { + font-weight: bold; +} + .documentation-language-picker a { margin-left: 8px; } diff --git a/tests/controller/documentation_helper_test.php b/tests/controller/documentation_helper_test.php index c93f652..edebc60 100644 --- a/tests/controller/documentation_helper_test.php +++ b/tests/controller/documentation_helper_test.php @@ -331,14 +331,17 @@ public function test_get_available_languages_reflects_the_build() public function test_imported_language_switcher_is_removed_but_labels_remain_available() { - file_put_contents($this->docs_root . '/da/index.html', ' -
Documentation home + // Hugo pages declare UTF-8, which DOMDocument needs to read the ⌂ correctly. + file_put_contents($this->docs_root . '/da/index.html', ' +
Article
'); $helper = $this->get_helper(); $result = $helper->resolve_and_load('da', ''); $this->assertStringContainsString('Documentation home', $result['breadcrumb_html']); $this->assertStringNotContainsString('language-switcher', $result['breadcrumb_html']); + $this->assertStringContainsString('Documentation home', $result['breadcrumb_html']); + $this->assertStringNotContainsString('⌂', $result['breadcrumb_html']); $this->assertStringNotContainsString('English', $result['breadcrumb_html']); $this->assertSame(array('da' => 'Dansk', 'en' => 'English'), $helper->get_language_labels()); } From 341af2841a94009b993aae3b105b363ed81ca5ef Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Wed, 7 Oct 2026 07:53:19 -0500 Subject: [PATCH 3/6] Use the documentation icon in the breadcrumb fa-file-text-o, the Documentation nav link's default icon, instead of the board's home icon. Co-Authored-By: Claude Opus 5.5 --- controller/documentation_helper.php | 15 +++++++++------ tests/controller/documentation_helper_test.php | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/controller/documentation_helper.php b/controller/documentation_helper.php index 733e216..8b55d3b 100644 --- a/controller/documentation_helper.php +++ b/controller/documentation_helper.php @@ -27,6 +27,9 @@ class documentation_helper /** Character Hugo's breadcrumb puts before its home link. */ const HUGO_HOME_GLYPH = '⌂'; + /** Font Awesome icon shown instead, matching the Documentation nav link's default icon. */ + const BREADCRUMB_HOME_ICON = 'fa-file-text-o'; + /** * The one top-level section name the developer docs build produces * (see phpbbdocs_hugo_devdocs.sh) — the sole boundary between @@ -861,7 +864,7 @@ protected function extract_fragments($file, $lang, $path, array $allowed_section { $switcher->parentNode->removeChild($switcher); } - $this->use_board_home_icon($breadcrumb_node); + $this->use_breadcrumb_home_icon($breadcrumb_node); $this->rewrite_absolute_links($breadcrumb_node); } $this->process_images($article_node, $lang, $path); @@ -876,14 +879,14 @@ protected function extract_fragments($file, $lang, $path, array $allowed_section } /** - * Replaces the "⌂" character Hugo puts before the breadcrumb's home - * link with the Font Awesome home icon the board's own breadcrumb - * uses, so both lines look the same. + * Replaces the small "⌂" character Hugo puts before the breadcrumb's + * home link with a Font Awesome icon, sized like the board's own + * breadcrumb icon. * * @param \DOMNode $breadcrumb_node * @return void */ - protected function use_board_home_icon(\DOMNode $breadcrumb_node) + protected function use_breadcrumb_home_icon(\DOMNode $breadcrumb_node) { $xpath = new \DOMXPath($breadcrumb_node->ownerDocument); $text = $xpath->query('.//a[1]/text()[1]', $breadcrumb_node)->item(0); @@ -894,7 +897,7 @@ protected function use_board_home_icon(\DOMNode $breadcrumb_node) $text->nodeValue = ltrim(substr(ltrim($text->nodeValue), strlen(self::HUGO_HOME_GLYPH))); $icon = $breadcrumb_node->ownerDocument->createElement('i'); - $icon->setAttribute('class', 'icon fa-home fa-fw'); + $icon->setAttribute('class', 'icon ' . self::BREADCRUMB_HOME_ICON . ' fa-fw'); $icon->setAttribute('aria-hidden', 'true'); $text->parentNode->insertBefore($icon, $text); } diff --git a/tests/controller/documentation_helper_test.php b/tests/controller/documentation_helper_test.php index edebc60..0051b2a 100644 --- a/tests/controller/documentation_helper_test.php +++ b/tests/controller/documentation_helper_test.php @@ -340,7 +340,7 @@ public function test_imported_language_switcher_is_removed_but_labels_remain_ava $result = $helper->resolve_and_load('da', ''); $this->assertStringContainsString('Documentation home', $result['breadcrumb_html']); $this->assertStringNotContainsString('language-switcher', $result['breadcrumb_html']); - $this->assertStringContainsString('Documentation home', $result['breadcrumb_html']); + $this->assertStringContainsString('Documentation home', $result['breadcrumb_html']); $this->assertStringNotContainsString('⌂', $result['breadcrumb_html']); $this->assertStringNotContainsString('English', $result['breadcrumb_html']); $this->assertSame(array('da' => 'Dansk', 'en' => 'English'), $helper->get_language_labels()); From b9cb9a9e94ca8499cf17ed82d09bf83b49d3745a Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Wed, 7 Oct 2026 07:57:07 -0500 Subject: [PATCH 4/6] Use fa-info-circle for the breadcrumb icon Co-Authored-By: Claude Opus 5.5 --- controller/documentation_helper.php | 4 ++-- tests/controller/documentation_helper_test.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controller/documentation_helper.php b/controller/documentation_helper.php index 8b55d3b..f4bc2df 100644 --- a/controller/documentation_helper.php +++ b/controller/documentation_helper.php @@ -27,8 +27,8 @@ class documentation_helper /** Character Hugo's breadcrumb puts before its home link. */ const HUGO_HOME_GLYPH = '⌂'; - /** Font Awesome icon shown instead, matching the Documentation nav link's default icon. */ - const BREADCRUMB_HOME_ICON = 'fa-file-text-o'; + /** Font Awesome icon shown instead. */ + const BREADCRUMB_HOME_ICON = 'fa-info-circle'; /** * The one top-level section name the developer docs build produces diff --git a/tests/controller/documentation_helper_test.php b/tests/controller/documentation_helper_test.php index 0051b2a..a8ffa8a 100644 --- a/tests/controller/documentation_helper_test.php +++ b/tests/controller/documentation_helper_test.php @@ -340,7 +340,7 @@ public function test_imported_language_switcher_is_removed_but_labels_remain_ava $result = $helper->resolve_and_load('da', ''); $this->assertStringContainsString('Documentation home', $result['breadcrumb_html']); $this->assertStringNotContainsString('language-switcher', $result['breadcrumb_html']); - $this->assertStringContainsString('Documentation home', $result['breadcrumb_html']); + $this->assertStringContainsString('Documentation home', $result['breadcrumb_html']); $this->assertStringNotContainsString('⌂', $result['breadcrumb_html']); $this->assertStringNotContainsString('English', $result['breadcrumb_html']); $this->assertSame(array('da' => 'Dansk', 'en' => 'English'), $helper->get_language_labels()); From 2753395bad87f7a5b5c0589e2c308b73f8039063 Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Wed, 7 Oct 2026 07:58:35 -0500 Subject: [PATCH 5/6] Add space above the documentation breadcrumb line Co-Authored-By: Claude Opus 5.5 --- styles/all/theme/documentation.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/styles/all/theme/documentation.css b/styles/all/theme/documentation.css index f140ecd..10f43d2 100644 --- a/styles/all/theme/documentation.css +++ b/styles/all/theme/documentation.css @@ -4,6 +4,8 @@ justify-content: space-between; flex-wrap: wrap; gap: 10px; + /* With phpBB's 4px .page-body margin, 10px above the line as well as below. */ + padding-top: 6px; margin-bottom: 10px; /* Same size as the board's own breadcrumbs (prosilver's ul.linklist > li). */ font-size: 1.1em; From a90be1035c0f328d28c3784ca391c90792e505fc Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Wed, 7 Oct 2026 07:59:43 -0500 Subject: [PATCH 6/6] Use 5px of space above the documentation breadcrumb line Co-Authored-By: Claude Opus 5.5 --- styles/all/theme/documentation.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/styles/all/theme/documentation.css b/styles/all/theme/documentation.css index 10f43d2..487e86c 100644 --- a/styles/all/theme/documentation.css +++ b/styles/all/theme/documentation.css @@ -4,8 +4,8 @@ justify-content: space-between; flex-wrap: wrap; gap: 10px; - /* With phpBB's 4px .page-body margin, 10px above the line as well as below. */ - padding-top: 6px; + /* With phpBB's 4px .page-body margin, 5px between the navbar and the line. */ + padding-top: 1px; margin-bottom: 10px; /* Same size as the board's own breadcrumbs (prosilver's ul.linklist > li). */ font-size: 1.1em;