Skip to content

Commit 569fdd5

Browse files
committed
fix(ui): theme toggle + VCS icon CSS, stop clobbering site-extra on prebuild, rename site to Food Truck Nerdz
Made-with: Cursor
1 parent a1b85e2 commit 569fdd5

9 files changed

Lines changed: 44 additions & 13 deletions

File tree

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ This playbook coordinates documentation from multiple repositories. Each reposit
4848

4949
Each component contains an `antora.yml` descriptor file (which defines the component `name` and `title`) and its documentation pages organized in the `modules/ROOT/` structure. The playbook pulls from each repository's Git source to build the unified documentation site. Short `title` values used in the component switcher: `ftn-site` → *Docs*; this *docs* repository’s meta component → *Docs*; `onboarding` → *Onboarding*; `food-truck-api` → *API*; `help` → *Public Help Portal*; `developer-portal` → *Developer Portal*.
5050

51-
The `site/supplemental-ui/` directory holds custom Handlebars partials, CSS, and JavaScript (mast bar, sidebar tree, Outfit font, header links, breadcrumb component/version pickers, etc.). Before every build, `site/scripts/sync-antora-dark-theme.cjs` copies `site-extra.css` and images from the current `antora-dark-theme` npm package into that folder, because Antora exposes only a single `ui.supplemental_files` path. `css/site-doc-layout.css`, `partials/`, and the layout scripts in this repository are *not* fully overwritten from npm on prebuild (only `site-extra.css` and `img/` sync; see `site/scripts/sync-antora-dark-theme.cjs`). The playbook `ui.bundle` uses link:https://github.com/antora-supplemental/antora-dark-theme[antora-supplemental/antora-dark-theme] release `ui-bundle.zip` as the base, with these supplemental files applied on top. Playbook `site.keys` and footer credits are documented in link:https://github.com/FoodTruckNerdz/docs/blob/main/docs/modules/ROOT/pages/docs-site-management.adoc#ui-bundle[Documentation Site Management] (section *UI bundle*); the published page is link:https://docs.foodtrucknerdz.com/docs/docs-site-management.html#ui-bundle[docs.foodtrucknerdz.com].
51+
The `site/supplemental-ui/` directory holds custom Handlebars partials, CSS, and JavaScript (mast bar, sidebar tree, Outfit font, header links, breadcrumb component/version pickers, etc.). Before every build, `site/scripts/sync-antora-dark-theme.cjs` copies only `img/` (VCS icons, etc.) from the `antora-dark-theme` npm package into that folder, because Antora exposes only a single `ui.supplemental_files` path. `css/site-extra.css`, `css/site-doc-layout.css`, `partials/`, and the layout scripts are maintained in this repository; merge upstream theme CSS from the package when you bump `antora-dark-theme` (see `site/scripts/sync-antora-dark-theme.cjs`). The playbook `ui.bundle` uses link:https://github.com/antora-supplemental/antora-dark-theme[antora-supplemental/antora-dark-theme] release `ui-bundle.zip` as the base, with these supplemental files applied on top. Playbook `site.keys` and footer credits are documented in link:https://github.com/FoodTruckNerdz/docs/blob/main/docs/modules/ROOT/pages/docs-site-management.adoc#ui-bundle[Documentation Site Management] (section *UI bundle*); the published page is link:https://docs.foodtrucknerdz.com/docs/docs-site-management.html#ui-bundle[docs.foodtrucknerdz.com].
5252

5353
== Documentation Sites
5454

antora-playbook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
site:
2-
title: Documentation
2+
title: Food Truck Nerdz
33
url: https://docs.foodtrucknerdz.com
44
start_page: docs::index.adoc
55
keys:

docs/modules/ROOT/pages/docs-site-management.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This repository (`docs`) contains the core configuration for the documentation s
2222
[[ui-bundle]]
2323
== UI bundle
2424

25-
The published site uses link:https://github.com/antora-supplemental/antora-dark-theme[antora-supplemental/antora-dark-theme] as the base Antora UI bundle (`ui.bundle.url` in the playbook; use the `releases/latest/download/ui-bundle.zip` asset). FoodTruckNerdz layers custom partials, CSS, and scripts on top via `site/supplemental-ui/`. The `package.json` `prebuild` step runs `site/scripts/sync-antora-dark-theme.cjs`, which copies `site-extra.css`, `site-ftn-docs.css`, and `img/` from the `antora-dark-theme` npm package into that folder, because Antora accepts only a single `ui.supplemental_files` path. The dark-mode script in `site/supplemental-ui/js/site-dark-mode.js` is **maintained in this repository** in lockstep with **antora-dark-theme 1.0+** (system / override behavior); bump the `antora-dark-theme` devDependency after a new theme release (push a `v*` tag on the theme repo; CI builds the release and can publish the npm package), then `pnpm install`.
25+
The published site uses link:https://github.com/antora-supplemental/antora-dark-theme[antora-supplemental/antora-dark-theme] as the base Antora UI bundle (`ui.bundle.url` in the playbook; use the `releases/latest/download/ui-bundle.zip` asset). FoodTruckNerdz layers custom partials, CSS, and scripts on top via `site/supplemental-ui/`. The `package.json` `prebuild` step runs `site/scripts/sync-antora-dark-theme.cjs`, which copies only `img/` from the `antora-dark-theme` npm package into that folder (supplemental `site-extra.css` and other CSS stay repo-maintained so CI does not overwrite FoodTruckNerdz-specific rules). The dark-mode script in `site/supplemental-ui/js/site-dark-mode.js` is **maintained in this repository** in lockstep with **antora-dark-theme 1.0+** (system / override behavior); bump the `antora-dark-theme` devDependency after a new theme release (push a `v*` tag on the theme repo; CI builds the release and can publish the npm package), then `pnpm install`.
2626

2727
Optional `site.keys` in the playbook control the footer label and link for the base theme (keep them aligned with the bundle you reference in `ui.bundle`):
2828

site/scripts/sync-antora-dark-theme.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ const destRoot = path.join(siteRoot, 'supplemental-ui')
99
const src = path.join(repoRoot, 'node_modules', 'antora-dark-theme', 'supplemental-ui')
1010

1111
const files = [
12-
['css', 'site-extra.css'],
12+
/* Do not copy site-extra.css from npm: CI prebuild would overwrite FTN card/tile + theme fixes.
13+
Merge upstream dark-theme changes from node_modules/antora-dark-theme/supplemental-ui/css/ manually. */
1314
/* site-doc-layout.css, partials, site-dark-mode.js, site-adt-accordion.js: maintained in this repo
1415
(FoodTruckNerdz branding: header, footer, truck logo, sticky-footer block at top of
1516
site-doc-layout.css). The package is the debranded baseline; do not prebuild-overwrite the full

site/supplemental-ui/css/site-doc-layout.css

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,22 +282,31 @@ a.adt-header-title:focus {
282282
filter: var(--adt-header-vcs-icon-filter, none);
283283
}
284284

285+
/* Sun/moon toggle: moon uses a filled path; sun uses stroked circle + lines — do not set fill:none on all paths */
285286
.header.adt-header .adt-header-icon-btn .theme-icon {
286287
width: 18px;
287288
height: 18px;
288289
display: block;
289-
fill: none;
290+
fill: currentColor;
290291
stroke: currentColor;
291292
stroke-width: 2;
292293
stroke-linecap: round;
293294
stroke-linejoin: round;
294295
}
295296

296-
.header.adt-header .adt-header-icon-btn .theme-icon path,
297297
.header.adt-header .adt-header-icon-btn .theme-icon circle {
298298
fill: none;
299299
}
300300

301+
.header.adt-header .adt-header-icon-btn .theme-icon line {
302+
stroke: currentColor;
303+
}
304+
305+
.header.adt-header .adt-header-icon-btn .theme-icon path {
306+
fill: currentColor;
307+
stroke: none;
308+
}
309+
301310
@media screen and (min-width: 1024px) {
302311
.adt-header .adt-topbar,
303312
.adt-header .adt-topbar .navbar-end {

site/supplemental-ui/css/site-extra.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,18 +428,26 @@ html.dark-theme .home-link {
428428
width: 18px;
429429
height: 18px;
430430
display: block;
431-
fill: none;
431+
fill: currentColor;
432432
stroke: currentColor;
433433
stroke-width: 2;
434434
stroke-linecap: round;
435435
stroke-linejoin: round;
436436
}
437437

438-
.theme-toggle .theme-icon path,
439438
.theme-toggle .theme-icon circle {
440439
fill: none;
441440
}
442441

442+
.theme-toggle .theme-icon line {
443+
stroke: currentColor;
444+
}
445+
446+
.theme-toggle .theme-icon path {
447+
fill: currentColor;
448+
stroke: none;
449+
}
450+
443451
/* Hide default Download button until JS replaces it (prevents flash on load) */
444452
.navbar .navbar-end a.button.is-primary[href="#"] {
445453
visibility: hidden;

site/supplemental-ui/css/site-ftn-docs.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,18 +254,26 @@ a.ftn-header-title:focus {
254254
width: 18px;
255255
height: 18px;
256256
display: block;
257-
fill: none;
257+
fill: currentColor;
258258
stroke: currentColor;
259259
stroke-width: 2;
260260
stroke-linecap: round;
261261
stroke-linejoin: round;
262262
}
263263

264-
.header.ftn-header .ftn-header-icon-btn .theme-icon path,
265264
.header.ftn-header .ftn-header-icon-btn .theme-icon circle {
266265
fill: none;
267266
}
268267

268+
.header.ftn-header .ftn-header-icon-btn .theme-icon line {
269+
stroke: currentColor;
270+
}
271+
272+
.header.ftn-header .ftn-header-icon-btn .theme-icon path {
273+
fill: currentColor;
274+
stroke: none;
275+
}
276+
269277
@media screen and (min-width: 1024px) {
270278
.ftn-header .ftn-topbar,
271279
.ftn-header .ftn-topbar .navbar-end {

site/supplemental-ui/js/site-dark-mode.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,12 @@
138138

139139
function vcsIconUrl(base, id) {
140140
const root = (base || ".").replace(/\/?$/, "/");
141-
return `${root}img/vcs/${id}.svg`;
141+
const rel = `${root}img/vcs/${id}.svg`;
142+
try {
143+
return new URL(rel, window.location.href).href;
144+
} catch {
145+
return rel;
146+
}
142147
}
143148

144149
function applyVcsIcons() {

site/supplemental-ui/partials/header-content.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<a class="adt-header-logo-item" href="{{{or (lookup site.keys 'foodtrucknerdz_com') 'https://foodtrucknerdz.com'}}}" rel="noopener" target="_blank" title="foodtrucknerdz.com" aria-label="foodtrucknerdz.com (opens in new tab)">
55
<img class="adt-header-logo" src="{{{uiRootPath}}}/img/foodtrucknerdz.svg" width="34" height="34" alt="" />
66
</a>
7-
<a class="navbar-item adt-header-title" href="{{{or site.url siteRootPath}}}">Documentation</a>
7+
<a class="navbar-item adt-header-title" href="{{{or site.url siteRootPath}}}">{{detag (or (lookup site.keys 'title_bar_brand') (or site.title 'Food Truck Nerdz'))}}</a>
88
</div>
99
<div id="topbar-nav" class="navbar-menu adt-topbar" role="navigation" aria-label="External links">
1010
<div class="navbar-end adt-header-actions">
1111
{{#if (and @root.page.origin @root.page.origin.webUrl)}}
1212
<a class="navbar-item adt-header-icon-btn adt-header-vcs" href="{{{@root.page.origin.webUrl}}}" rel="noopener" target="_blank" title="Source repository" aria-label="Source repository (opens in new tab)">
13-
<img class="adt-header-vcs-img" src="{{{uiRootPath}}}/img/vcs/code.svg" width="24" height="24" alt="" />
13+
<img class="adt-header-vcs-img" src="{{{uiRootPath}}}/img/vcs/github.svg" width="24" height="24" alt="" />
1414
</a>
1515
{{else}}
1616
<a class="navbar-item adt-header-icon-btn adt-header-vcs" href="{{{or (lookup site.keys 'github_profile_url') 'https://github.com/FoodTruckNerdz'}}}" rel="noopener" target="_blank" title="Project on GitHub" aria-label="Project on GitHub (opens in new tab)">

0 commit comments

Comments
 (0)