Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/apursley2012/y2k-web/llms.txt

Use this file to discover all available pages before exploring further.

y2k-web uses React Router v6’s hash history strategy (HashRouter / _p in the compiled bundle, backed by Lf — the hash history factory). With hash routing, every URL takes the form https://example.com/#/about rather than https://example.com/about. This means the browser never makes an HTTP request for the path segment — the server always serves the same root index.html and the client-side router reads everything after #. This makes the app compatible with any static file host, including GitHub Pages, without requiring any server-side URL rewrites or redirect rules.

Route table

Hash URLComponentPage title
/#/Mp (Home)Home page
/#/aboutDp (About)About Me
/#/projectsFp (Projects)Projects showcase
/#/workUp (Work / Resume)Resume / Work history
/#/case-studiesBp (Case Studies)Case Studies
/#/blogVp (Blog)Web Log (blog)
/#/testimonials$p (Testimonials)Testimonials / Guestbook
/#/contactAp (Contact)Contact form with IM chat

App component routing structure

The root Yp component wraps everything in the hash router (_p, aliased from HashRouter). Inside, the nav bar (Qp) and footer (Kp) are rendered outside the <Routes> tree so they are present on every page. The <Routes> block (compiled as Sp) contains one <Route> (Ae) per page:
function App() {
  return (
    <HashRouter>
      <div className="min-h-screen flex flex-col selection:bg-retro-pink selection:text-white">
        <CursorTrail />
        <Nav />
        <main className="flex-grow">
          <Routes>
            <Route path="/"            element={<Home />} />
            <Route path="/about"       element={<About />} />
            <Route path="/projects"    element={<Projects />} />
            <Route path="/work"        element={<Work />} />
            <Route path="/case-studies" element={<CaseStudies />} />
            <Route path="/blog"        element={<Blog />} />
            <Route path="/testimonials" element={<Testimonials />} />
            <Route path="/contact"     element={<Contact />} />
          </Routes>
        </main>
        <Footer />
      </div>
    </HashRouter>
  );
}
The nav bar reads the current pathname with useLocation() (sr() in the bundle) to highlight the active tab using the Windows 98-style shadow-win-in pressed-button class.

Static page bootstrapping

Each file under pages/ is a thin HTML wrapper that sets the correct hash before the React bundle loads. This handles the case where a user bookmarks or shares a direct link to pages/About.html — without the inline script, the hash would default to #/ and the SPA would render the home page instead of About. The pattern from pages/About.html:
<script>
  window.__STATIC_PAGE_ROUTE__ = "/about";
  if (!window.location.hash || window.location.hash === "#/" || window.location.hash === "#") {
    window.location.hash = "/about";
  }
</script>
The logic is:
  1. Store the intended route on window.__STATIC_PAGE_ROUTE__ for any app code that needs it.
  2. Guard against overwriting an existing deep-link hash — if the user already has a hash (e.g., an anchor link within the page), it is preserved.
  3. Set the hash to /about, which HashRouter then parses as the pathname /about and renders the About component.
All page HTML files in pages/ share the same assets/main.js bundle and assets/main.css stylesheet. There is only one copy of the React application; the HTML wrappers differ only in their <title> and the bootstrapping script values. This means a single Vite build produces everything needed for every route.

Adding a new route

To add a new page (e.g., /uses):
  1. Create a page component in your application source (e.g., a Uses component).
  2. Add a <Route> inside the <Routes> block in App:
    <Route path="/uses" element={<Uses />} />
    
  3. Add a nav entry to the t array in the Nav component:
    { path: "/uses", label: "Uses" }
    
  4. Create pages/Uses.html by copying any existing page file and updating the <title>, window.__STATIC_PAGE_ROUTE__, and window.location.hash values to /uses.
  5. Run vite build to rebuild assets/main.js and assets/main.css.

Build docs developers (and LLMs) love