Migrate bnd docs to just-the-docs Jekyll theme with dark mode toggle#7150
Migrate bnd docs to just-the-docs Jekyll theme with dark mode toggle#7150
Conversation
|
Great, Looks ver< nice :) @peterkir |
|
@copilot add a dark mode toggle as found inside the doc folder of this repo https://github.com/klibio/apps/tree/main/_doc |
Added a three-state dark mode toggle (commit
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
6b59606 to
70daa30
Compare
Signed-off-by: Peter Kirschner <peter@klib.io>
- Replace github-pages gem with just-the-docs 0.12.0 and jekyll 4.4 - Add just-the-docs theme config with search, aux links, edit-on-GitHub - Create custom bnd layout that wraps just-the-docs default and renders page.summary - Rename old custom layouts to bnd-legacy-* (no longer override theme) - Create section parent pages in _chapters (Getting Started, Concepts, etc.) - Update front matter on all 44 chapter files (parent, nav_order) - Update front matter on all 455 collection files (parent, layout) - Configure just_the_docs.collections for chapters nav and reference nav_exclude - Fix double-slash in GitHub edit links (override footer.html) - Add custom SCSS for summary callout boxes and copy button styling - Add head_custom.html for favicon and meta tags - New index.md home page with Quick Start examples - Regenerate Gemfile.lock for Jekyll 4.4 / just-the-docs 0.12.0 Co-authored-by: peterkir <250545+peterkir@users.noreply.github.com> Signed-off-by: Peter Kirschner <peter@klib.io>
…l ~> 4.4, just-the-docs ~> 0.12) Co-authored-by: peterkir <250545+peterkir@users.noreply.github.com> Signed-off-by: Peter Kirschner <peter@klib.io>
Mirrors the pattern from klibio/apps/_doc/_layouts/default.html: - Three-state cycle: Auto -> Light -> Dark -> Auto - Button in header shows current state label (◐ Auto / ☀ Light / ☾ Dark) - No-flash script in <head> applies stored preference before first paint - OS preference respected in Auto mode, re-evaluated on media change - Preference persisted to localStorage under key 'theme-preference' - Uses built-in jtd.setTheme() to swap just-the-docs stylesheets Co-authored-by: peterkir <250545+peterkir@users.noreply.github.com> Signed-off-by: Peter Kirschner <peter@klib.io>
Signed-off-by: Peter Kirschner <peter@klib.io>
using Just-The-Docs template provides * integrated search capability * Nav Bar additionally added functionalities * added light/dark mode switch button with browser setting consideration * included code snippets display with type label e.g. properties, xml, java * NavBar is updating to selected content (e.g. after search and access) * GitHub menu bar link navigates directly to page for editing Signed-off-by: Peter Kirschner <peter@klib.io>
first draft Signed-off-by: Christoph Rueger <chrisrueger@gmail.com> Signed-off-by: Peter Kirschner <peter@klib.io>
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com> Signed-off-by: Peter Kirschner <peter@klib.io>
Signed-off-by: Peter Kirschner <peter@klib.io>
Signed-off-by: Peter Kirschner <peter@klib.io>
… baselining Signed-off-by: Peter Kirschner <peter@klib.io>
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com> Signed-off-by: Peter Kirschner <peter@klib.io>
Signed-off-by: Peter Kirschner <peter@klib.io>
Signed-off-by: Peter Kirschner <peter@klib.io>
Signed-off-by: Peter Kirschner <peter@klib.io>
70daa30 to
5a6b674
Compare
|
@peterkir looks like some unrelated things sneaked in again. |
|
@chrisrueger |
Signed-off-by: Peter Kirschner <peter@klib.io>
Let's merge :) |


Converts the bnd documentation site from a custom hand-rolled Jekyll theme to just-the-docs, preserving all existing content.
Theme & Build
github-pagesgem withjekyll ~> 4.4+just-the-docs ~> 0.12theme: just-the-docswith search, GitHub/bndtools.org aux links, edit-on-GitHub, footer, and back-to-topNavigation Structure
_chapters/(000-getting-started.md,000-concepts.md, etc.) — just-the-docs resolves parent–child relationships within a collection, so parents must live in the same collection as their childrenparent:+nav_order:_commands,_instructions,_macros,_heads,_plugins,_tools) with matchingparent:titlesjust_the_docs.collections: chapters shown in nav; reference collections registered withnav_exclude: true(keeps sidebar clean while still enabling breadcrumbs)Layout & Custom Overrides
_layouts/bnd.html— wraps just-the-docsdefaultand renderspage.summaryas a styled callout box; essential for auto-generated reference pages that carry all descriptive content in that fieldbnd-legacy-*.html(not deleted)_includes/components/footer.html— patches a just-the-docs bug: emptycollections_diris""which is truthy in Liquid, causing a double-slash in GitHub edit URLs (docs//_commands/wrap.md); fixed by addingand site.collections_dir != ""_sass/custom/custom.scss— summary callout box, code-copy button, and theme toggle button stylesindex.md— replaced minimal stub with a proper home page (Quick Start for CLI, Maven, Gradle, workspace)Dark Mode Toggle
A three-state color-scheme toggle is added to the header, modelled on the pattern from klibio/apps
_doc/_layouts/default.html:prefers-color-schememedia query and re-evaluates when it changes<script>in<head>readslocalStorage('theme-preference')and swaps the just-the-docs stylesheet before the first paint, preventing flash-of-wrong-theme (FOUC)localStorageunder keytheme-preferencejtd.setTheme()API to swapjust-the-docs-light.css↔just-the-docs-dark.cssScreenshots
Home page (light mode):
Hierarchical sidebar with expanded section and breadcrumb:
Command reference page —
page.summaryrendered as callout:Dark mode:
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.