Skip to content

fix: make PWA manifest and apple-touch-icon paths baseUrl-aware - #386

Merged
mrbobbytables merged 1 commit into
mainfrom
fix/pwa-manifest-baseurl-paths
Sep 21, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
fix/pwa-manifest-baseurl-paths

Conversation

@mrbobbytables

Copy link
Copy Markdown
Member

Summary

The PWA manifest link and apple-touch-icon href in docusaurus.config.js headTags were emitted as root-absolute paths (/manifest.json, /favicons/apple-touch-icon.png). On the GitHub Pages deployment, which sets BASE_URL=/endusers/, these resolve to the origin root and 404, since Docusaurus injects headTags verbatim without rewriting them with baseUrl.

static/manifest.json had the same problem: start_url: "/" and root-absolute icon src values, so even if the manifest were reached, the installed app would start at and load icons from the wrong path.

This PR:

  • Builds the headTags hrefs from the normalized baseUrl (same pattern already used for the structured-data logo URL on line 63).
  • Switches static/manifest.json to relative paths (start_url: ".", icon src values without a leading slash) so the manifest resolves correctly against its own URL under any baseUrl.

Closes #302

Verification

Built locally with SITE_URL=https://castrojo.github.io BASE_URL=/endusers/ npm run build and confirmed in the generated build/index.html and build/manifest.json:

  • <link rel=manifest href=/endusers/manifest.json>
  • <link ... apple-touch-icon ... href=/endusers/favicons/apple-touch-icon.png>
  • build/manifest.json has start_url: "." and relative icon src values.

Also verified a default (BASE_URL=/) build still resolves correctly.

Checklist

  • Content speaks to end users (see CONTRIBUTING.md)
  • Commits are DCO-signed (git commit -s)
  • Site builds without new warnings

— hive: backend=copilot model=claude-sonnet-5

🐝 Hive Agent: contributor | SHA: 1399531

The manifest link and apple-touch-icon href in headTags were
root-absolute paths, so on GitHub Pages deployments with
BASE_URL=/endusers/ they resolved to the origin root and 404'd.
Docusaurus injects headTags verbatim without rewriting them with
baseUrl.

Build the hrefs from the normalized baseUrl (same pattern already
used for the structured-data logo URL), and switch static/manifest.json
to relative paths (start_url and icon srcs) so the manifest and its
icons resolve correctly under any baseUrl.

Fixes #302

Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
@mrbobbytables
mrbobbytables added this pull request to the merge queue Sep 21, 2026
Merged via the queue into main with commit 999072d Sep 21, 2026
2 checks passed
@castrojo
castrojo deleted the fix/pwa-manifest-baseurl-paths branch September 21, 2026 15:14
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.

[scanner] PWA manifest and apple-touch-icon 404 on GitHub Pages deployment: root-absolute paths ignore BASE_URL=/endusers/

1 participant