Skip to content

feat(packages/config): add banner/favicon config + fix nav-logo fallback#119

Merged
zrosenbauer merged 3 commits into
mainfrom
fix/nav-logo-and-asset-paths
Jun 10, 2026
Merged

feat(packages/config): add banner/favicon config + fix nav-logo fallback#119
zrosenbauer merged 3 commits into
mainfrom
fix/nav-logo-and-asset-paths

Conversation

@zrosenbauer

Copy link
Copy Markdown
Member

Summary

  • Fix: the navbar no longer overrides the auto-generated /logo.svg with the hardcoded <CiderpressLogo /> wordmark when no logo is configured. Sites that committed their own public/logo.svg already won this round; sites that didn't were silently getting the ciderpress wordmark in their topbar.
  • New: two top-level config fields for overriding auto-generated asset paths — banner (hero image, defaults /banner.svg) and favicon (defaults /icon.svg).
  • No brand: namespace — logo is 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 — return null when logo is undefined so Rspress's native <img src="/logo.svg"> paints through. The portal now only mounts for function-form logos. The themed wordmark stays available via logo: ({ theme }) => <CiderpressLogo />.

packages/config/src/types.ts + schema.ts — add banner?: string and favicon?: string to CiderpressConfig. Schema regenerated.

packages/cli/src/lib/sync/home.ts — home hero image.src now reads config.banner ?? '/banner.svg'.

packages/ui/src/config.ts — favicon now reads config.favicon ?? '/icon.svg'. (Previously was config.icon ?? '/icon.svg', which was nonsensical — the icon field validates as an Iconify id, so the fallback was unreachable in practice for users with a valid icon set.)

Changeset: minor bump on ciderpress, @ciderpress/cli, @ciderpress/config, @ciderpress/ui.

Test plan

  • pnpm check (typecheck + lint + format) — passes locally
  • Visual: spin up examples/simple (no logo configured) and confirm the auto-generated logo SVG shows in the navbar instead of the ciderpress wordmark
  • Visual: set logo: ({ theme }) => <CiderpressLogo /> in a test config and confirm the wordmark still renders
  • Set banner: '/assets/hero.png' in an example config and confirm the home hero image swaps
  • Set favicon: '/favicon.ico' and confirm the tab icon swaps

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.
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ciderpress Ready Ready Preview, Comment Jun 10, 2026 3:53am

@argos-ci

argos-ci Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 1 changed Jun 10, 2026, 3:56 AM

… 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
@zrosenbauer zrosenbauer merged commit f71d7f4 into main Jun 10, 2026
6 of 7 checks passed
@zrosenbauer zrosenbauer deleted the fix/nav-logo-and-asset-paths branch June 10, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant