← gitpulse
Bug Fix·Pushed May 1, 2026·S

Favicon and title fixed for GitHub Pages

The site favicon now loads correctly when deployed to GitHub Pages, and the home page displays a matching tab title consistent with the reference implementation.

When Gitpulse was deployed to GitHub Pages, the favicon silently failed to load — browsers looked for [[code]]/favicon.svg[[/code]] instead of [[code]]/gitpulse/favicon.svg[[/code]]. The home page tab title was also misbehaving, showing a generic title instead of the expected "{publicationName} — Gitpulse" pattern. The favicon path now uses the same basePath logic that next.config.js relies on, deriving the repository path from the [[code]]GITHUB_REPOSITORY[[/code]] environment variable. The home page gains a [[code]]generateMetadata[[/code]] function that constructs the title dynamically from the publication name configured for the repository. These fixes ensure the site renders correctly in all deployment contexts and the browser tab shows meaningful, contextually appropriate information.
Technical description
Two metadata issues are addressed in the [[code ref=1]]GITHUB_REPOSITORY[[/code]] environment-aware site deployment. **Favicon basePath resolution** The favicon was being served from a hardcoded [[code]]/favicon.svg[[/code]] path, which fails on GitHub Pages where the site lives under a repository prefix. The fix introduces [[code ref=2]]REPO_BASE_PATH[[/code]], a constant derived from the [[code]]GITHUB_REPOSITORY[[/code]] environment variable. If the environment is set (as it would be in GitHub Actions), it extracts the repo name and formats it as [[code]]/${repo}[[/code]]. Otherwise it falls back to an empty string for local development. The [[code ref=3]]favicon.svg[[/code]] URL in the metadata icons array is now constructed as `[[code]] [[/code]]${REPO_BASE_PATH}/favicon.svg[[code]] [[/code]]`, ensuring the icon resolves correctly whether the site is served from root or a subdirectory. **Home page dynamic metadata** The home page now exports a [[code ref=4]]generateMetadata[[/code]] function that replaces the static title inherited from the root layout. It loads the repo configuration and builds a title string using [[code ref=5]]publicationName[[/code]], producing "{publicationName} — Gitpulse" which matches the pattern used in the gitsky reference implementation. ````tsx file=site/src/app/page.tsx export function generateMetadata(): Metadata { const repo = loadRepo(); return { title: [[code]]${publicationName(repo)} — Gitpulse[[/code]], description: publicationSubtitle(repo), }; } ```` Files at a Glance: - [[code]]site/src/app/layout.tsx[[/code]] — Favicon path now includes basePath prefix - [[code]]site/src/app/page.tsx[[/code]] — Home page exports dynamic metadata generator

Categories

  • Bug Fix (60%)Two distinct bugs are fixed: the favicon path was missing the GitHub Pages basePath prefix, and the home page title wasn't matching the reference implementation's pattern
  • Configuration (30%)The fix derives REPO_BASE_PATH from the GITHUB_REPOSITORY environment variable, mirroring the basePath logic used in next.config.js
  • New Feature (10%)A new generateMetadata function is added to the home page, enabling proper dynamic metadata generation