diff --git a/CUSTOMIZATIONS.md b/CUSTOMIZATIONS.md index e268148..cc88a34 100644 --- a/CUSTOMIZATIONS.md +++ b/CUSTOMIZATIONS.md @@ -50,6 +50,7 @@ The old production site (`docu.djeex.fr`) has an established visual identity tha - `ui.colors`: primary `cyan`, neutral `zinc` — the site's brand accent color and its neutral gray scale. - `ui.prose.card` / `ui.prose.pre` / `ui.header` / `ui.contentSearchButton` / `ui.contentSurround` / `ui.kbd`: exact background/border hex values (a shared `rgba(12,13,12,0.8)` translucent-dark family, e.g. `#121110` borders) matching the old site's card, code-block, header, search button, and prev/next-link chrome, since Nuxt UI's defaults use a different neutral scale that didn't match. - `ui.prose.callout.compoundVariants`: exact colors for all four admonition severities (info/success/warning/error), overriding Nuxt UI's default callout palette so `::note`, `::tip`, `::warning`, `::caution` render in the same colors the old site's `::alert` boxes used, rather than Nuxt UI's stock blue/green/amber/red. +- `toc.bottom.links` / `toc.bottom.title` — no component override needed for this one: Docus's own `DocsAsideRightBottom.vue` already reads `appConfig.toc?.bottom?.links` and renders them via `UPageLinks` under the right-hand table of contents, it's just never set by default. This surfaces the same "other projects" links (git.djeex.fr, Lumeex, Instameex) shown on the landing page's "Other dumb things" section, at the bottom of every doc page's TOC too, instead of only being visible from the homepage. ## Custom / overridden components (`app/components/`) @@ -63,6 +64,7 @@ Nuxt's convention is that a file at `app/components//` block's CSS class rules aren't resolved at all (paths fell back to default black fill) — both needed stripping/inlining by hand in `fetchLogoSvg()` before the SVG string reaches `v-html`. `content/en/index.md` and `content/fr/index.md` skip this template entirely via the `seo.ogImage` frontmatter key (Docus's `landing.vue` checks for it and falls back to a fixed `/img/social.png` instead of generating one), since the homepage's own hero doesn't fit this per-doc-page layout. - **`content/FileTree.vue` + `content/FileTreeNode.vue`** (new; no Docus or Nuxt UI equivalent exists at all). Every install guide used to show its folder layout as a plain ASCII-art code fence (`└──`/`├──`); this renders the same information as an actual tree with per-entry folder/file icons instead, reusing the exact filename/extension icon lookup `CodeIcon.vue` already does for labeled code fences, so a `.env` or `.conf` gets the same icon here as in a fence header. Registered as the container component `::file-tree`, fed through a YAML props block (`remark-mdc`'s `---\n...\n---` syntax) rather than a nested markdown list, since the data (name, whether it's a folder, its children) doesn't map cleanly onto list semantics otherwise. A trailing `/` on a plain string marks an otherwise-childless folder (a mapping key is unambiguously a folder already); a trailing `" # comment"` on either form renders as a dimmed, italic aside, matching a real code comment without being one (an actual unquoted YAML `#` would just be stripped by the parser before the component ever saw it). The header doubles as a collapse toggle (`collapsed` prop sets the initial state only), and clicking any row copies that entry's full path to the clipboard. ## Page-level features (`app/pages/[[lang]]/[...slug].vue`) diff --git a/app/components/OgImage/Docs.takumi.vue b/app/components/OgImage/Docs.takumi.vue index 958a357..a6f9cba 100644 --- a/app/components/OgImage/Docs.takumi.vue +++ b/app/components/OgImage/Docs.takumi.vue @@ -4,10 +4,47 @@ const { title, description, headline } = defineProps<{ title?: string, descripti const appConfig = useAppConfig() const { name: siteName } = useSiteConfig() const primaryColor = appConfig.ui?.colors?.primary ?? 'emerald' +const logoPath = appConfig.header?.logo?.dark || appConfig.header?.logo?.light +const logoHeight = 40 + +const logoSvg = await fetchLogoSvg(logoPath) + +async function fetchLogoSvg(path?: string): Promise { + if (!path) return '' + try { + const { url: siteUrl } = useSiteConfig() + const url = path.startsWith('http') ? path : `${siteUrl}${path}` + let svg = await $fetch(url, { responseType: 'text' }) + + // Strip the XML prolog and comments: takumi renders them as literal text + // instead of ignoring them like a browser's innerHTML would. + svg = svg.replace(/<\?xml[^>]*\?>/, '').replace(//g, '').trim() + + // takumi doesn't resolve the SVG's own