Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/dyed-in-the-wool/llms.txt
Use this file to discover all available pages before exploring further.
The Problem
GitHub Pages is a static file host — it serves files exactly as they exist on disk. When a visitor navigates directly to a deep URL such asusername.github.io/dyed-in-the-wool/about, GitHub looks for a file at about/index.html. That file does not exist, so GitHub returns a 404.
This is a common pain point for single-page applications where the router lives entirely in JavaScript and only index.html is ever physically present.
The Solution: HashRouter + Static HTML Stubs
Dyed in the Wool solves this with two complementary strategies:-
HashRouter — React Router is configured with
HashRouter, so every URL uses the hash fragment:/#/about,/#/projects,/#/contact, etc. GitHub Pages always servesindex.htmlfor the root path, and the hash portion is handled entirely by the browser — no server involvement required. -
Static HTML stubs — A small HTML file lives alongside the root
index.htmlfor every route (e.g.pages/About.html). Each stub loads the same JS/CSS bundle and runs a tiny script that sets the correct hash before the app boots, so direct links topages/About.htmlland on the right page.
Static Page Template
Every page stub follows this structure (from the actual source inpages/About.html):
- Records the intended route in
window.__STATIC_PAGE_ROUTE__for potential use by app code or analytics. - Sets
window.location.hashto the correct route path if the hash is empty or set to the root#/. This fires before the React bundle boots, so the router always sees the right initial location.
Current Static Pages
| File | Route |
|---|---|
index.html | /#/ (root) |
pages/About.html | /#/about |
pages/Projects.html | /#/projects |
pages/Skills.html | /#/skills |
pages/Work.html | /#/work |
pages/Contact.html | /#/contact |
Adding a New Route
Add the React route
Register the new route inside the app’s router. Add a
<Route> entry alongside the existing routes in your app entry point:Create the static HTML stub
Create
pages/NewPage.html using the template above. Update the two route-specific values:Update the nav
Add the new route to the
navLinks array in Layout.js so it appears in the site navigation:Each page stub (including
index.html) contains <link rel="modulepreload"> tags that reference component files by relative path — for example ./components/DyeDropCursor.js, ./components/Layout.js, and ./components/TieDyeBackground.js. These hints tell the browser to fetch those chunks early. If you rename or move component files during development, remember to update these paths in every static HTML file to avoid broken preloads.