# Build a Multi-Page Static Site With Claude Code

Canonical: https://figment.so/blog/build-multipage-site-with-claude-code

Give Claude Code an approved page map in an empty Git repository, have it write a small static file tree with correct relative links, then test every route locally before you deploy.

**To build a multi-page static site with Claude Code, approve a page map first, ask Claude Code to create a small static file tree in an empty repository, and test every route before deployment.** The output is a new multi-page repository with linked local pages, not a live domain. To change a site that already exists, use [the existing static-site editing guide](/blog/edit-a-static-website-with-claude-code) instead.

## What should the brief say before you start?

The brief is a page map in which each page has a distinct job. This fictional example uses Northline Bicycle Repair: `/` introduces the shop, `/services/` lists two approved services, and `/contact/` gives one contact method. The name and service facts are example inputs, and `hello@example.com` is a placeholder. No price, opening time, review, or repair promise has been provided, so none belongs in the generated site.

Write acceptance checks beside the map:

- All three pages load.
- Navigation reaches each page.
- The contact link uses the approved address.
- The services page contains only flat repair and brake adjustment.
- The layout stays readable on a phone.

If your brief has only one real reader task, build one page instead. The [single-page ChatGPT guide](/blog/build-static-landing-page-with-chatgpt) covers that smaller output.

## How do you open Claude Code in a new repository?

Create a new folder for the site, initialize Git, and start `claude` inside it:

```bash
mkdir northline-site
cd northline-site
git init
claude
```

These commands describe what to do; we did not run a Claude Code session for this article. Anthropic's [current quickstart](https://code.claude.com/docs/en/quickstart) gives installation methods, account requirements, and the `claude` command. Claude Code requires a supported subscription, Console account, or provider access. Depending on the session's permission mode and your settings, it may edit files or run commands in the folder, so check the mode before you approve work. Keep unrelated projects and credentials out of this folder.

## What task should you give the agent?

Paste the approved brief, then give Claude Code a concrete file and route contract:

> Build a new, dependency-free static site from the brief below. Create `index.html`, `services/index.html`, `contact/index.html`, and one shared `styles.css` at the root. Use relative links that work from nested pages and when hosted below a path prefix. Use semantic headings and visible keyboard focus. Add no JavaScript, form, remote asset, fabricated business fact, or deployment setup. Do not commit or publish. After writing, list each file, each route, every placeholder, and the checks you actually ran. Here is the approved brief: [paste brief].

The expected artifact has this shape:

```text
northline-site/
  index.html
  styles.css
  services/
    index.html
  contact/
    index.html
```

Relative links need care here. From the home page, `services/` reaches the services page. From `services/index.html`, that same text resolves inside `services/` again. A navigation block copied across files needs page-specific paths, or a build system that resolves links. For this small site, use these relative paths:

| File | Home link | Services link | Contact link | CSS link |
| --- | --- | --- | --- | --- |
| `index.html` | `./` | `services/` | `contact/` | `styles.css` |
| `services/index.html` | `../` | `./` | `../contact/` | `../styles.css` |
| `contact/index.html` | `../` | `../services/` | `./` | `../styles.css` |

Each page needs its own `<nav>` with those `href` values and a `<link rel="stylesheet" href="...">` using the CSS column. The runnable three-page fixture in the research record uses this table. A root-relative `/services/` path might work at a domain root but fail when the site is hosted below a project prefix.

## How do you verify each route?

First check that the finished folder includes the root `index.html`, the nested page folders, and the CSS, plus any JavaScript and images you asked for. Give any missing paths back to Claude Code, fix the source, and check the new output again.

In an empty repository, ordinary `git diff` does not show untracked files. Run `git diff --no-index /dev/null index.html` or inspect the new files directly, and read all files before staging them. Check for unauthorized claims and unexpected network calls. Then run `python3 -m http.server 8000` from the project root. [MDN documents](https://developer.mozilla.org/en-US/docs/Learn_web_development/Howto/Tools_and_setup/set_up_a_local_testing_server) this local preview method.

Open `http://localhost:8000/`, `http://localhost:8000/services/`, and `http://localhost:8000/contact/`. On each route, use the navigation to reach the other pages. Check the browser network panel for missing CSS or images. Test the email link from the contact page, and replace the placeholder address before launch. Resize to a narrow phone width and use the keyboard to move through links. Fix a failed route before adding more pages.

If you need subpath hosting, copy the complete site folder into a parent preview folder as `project/`, run the server from that parent, and also test `http://localhost:8000/project/`, `/project/services/`, and `/project/contact/`. Each navigation and stylesheet URL must resolve from its page. For example, `../styles.css` from `/project/services/` resolves to `/project/styles.css`. The local browser fixture for this guide tested that mapping at 320 and 1440 px. It does not prove that a different host uses the same directory-routing rule, so check the deployed host too.

Ask Claude Code to report its tests, but do not take its statement as proof. Anthropic's [quickstart](https://code.claude.com/docs/en/quickstart) describes file edits and tests as possible tasks; it does not guarantee that every requested check was run. Your route table is the acceptance artifact:

| Route | Expected heading | Navigation | Status to record |
| --- | --- | --- | --- |
| `/` | Shop name and service summary | Services, Contact | Pass or failure |
| `/services/` | Services | Home, Contact | Pass or failure |
| `/contact/` | Contact | Home, Services | Pass or failure |

Record actual results, not a prefilled "pass." If you add a fourth page, add a row and repeat the link checks. Commit only after you have reviewed the source and the local browser result. Then follow [the static-file publishing guide](/blog/publish-ai-generated-static-website).

## Where do these facts come from?

- [Anthropic, Claude Code quickstart](https://code.claude.com/docs/en/quickstart), accessed 2026-09-23. Used for CLI startup, account requirements, permission-mode caution, and agent tasks.
- [Anthropic, Claude Code permissions](https://code.claude.com/docs/en/permissions), accessed 2026-09-23. Used for the instruction to check the session mode.
- [MDN, set up a local testing server](https://developer.mozilla.org/en-US/docs/Learn_web_development/Howto/Tools_and_setup/set_up_a_local_testing_server), accessed 2026-09-23. Used for local route preview.
