feat(packages/config): add banner/favicon config + fix nav-logo fallback#119
Merged
Conversation
Nav-logo no longer overrides the auto-generated `/logo.svg` with the
hardcoded `<CiderpressLogo />` wordmark when no `logo` is configured.
The portal now only mounts for function-form logos; string and missing
cases ride Rspress's native `<img>`, so sites without an explicit logo
finally see the SVG written to their public dir by the banner module.
The themed wordmark stays available via
`logo: ({ theme }) => <CiderpressLogo />`.
Adds two top-level config fields for overriding auto-generated asset
paths:
- `banner?: string` — hero image used in `home.ts` (defaults `/banner.svg`)
- `favicon?: string` — favicon path (defaults `/icon.svg`)
Convention (auto-gen + `<!-- ciderpress-generated -->` marker) still
carries the default case; these fields are only needed to point at a
different filename or a CDN URL.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
… fix/nav-logo-and-asset-paths # Conflicts: # .changeset/pre.json
Demonstrates the function-form `logo` portal path post nav-logo refactor. examples/simple stays unconfigured so the two examples together prove both code paths: - examples/simple → no `logo` → auto-generated `/logo.svg` (from title) - examples/kitchen-sink → function-form → themed CiderpressLogo wordmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/logo.svgwith the hardcoded<CiderpressLogo />wordmark when nologois configured. Sites that committed their ownpublic/logo.svgalready won this round; sites that didn't were silently getting the ciderpress wordmark in their topbar.banner(hero image, defaults/banner.svg) andfavicon(defaults/icon.svg).brand:namespace —logois already top-level,icon(Iconify id for the inline topbar mark) is a different concern, and convention + the existing/new top-level fields cover the surface without API churn.Changes
packages/ui/src/theme/components/nav/nav-logo.tsx— returnnullwhenlogoisundefinedso Rspress's native<img src="/logo.svg">paints through. The portal now only mounts for function-form logos. The themed wordmark stays available vialogo: ({ theme }) => <CiderpressLogo />.packages/config/src/types.ts+schema.ts— addbanner?: stringandfavicon?: stringtoCiderpressConfig. Schema regenerated.packages/cli/src/lib/sync/home.ts— home heroimage.srcnow readsconfig.banner ?? '/banner.svg'.packages/ui/src/config.ts— favicon now readsconfig.favicon ?? '/icon.svg'. (Previously wasconfig.icon ?? '/icon.svg', which was nonsensical — theiconfield validates as an Iconify id, so the fallback was unreachable in practice for users with a validiconset.)Changeset: minor bump on
ciderpress,@ciderpress/cli,@ciderpress/config,@ciderpress/ui.Test plan
pnpm check(typecheck + lint + format) — passes locallyexamples/simple(nologoconfigured) and confirm the auto-generated logo SVG shows in the navbar instead of the ciderpress wordmarklogo: ({ theme }) => <CiderpressLogo />in a test config and confirm the wordmark still rendersbanner: '/assets/hero.png'in an example config and confirm the home hero image swapsfavicon: '/favicon.ico'and confirm the tab icon swaps