Give your website real pages
Add About and Contact, link them together, and serve an image from your own project.
Allow 10–20 minutes. This is an editorial estimate. Continue in the same my-site folder; do not create another starter.
Read
Start at L01. Your homepage shows “I am building my own website.” The starter already has site/index.html, components/layout.html, site/application.what and static/. Leave run-what dev running from my-site.
A file in site/ becomes a page: site/index.html is /, site/about.html is /about, and site/contact.html is /contact. The URL does not include site/ or .html. An ordinary HTML link moves between pages.
A file in static/ is served as an asset, unchanged. Here an SVG is a small image described with text, so you can create it in the same editor. The image is supplied with this tutorial; no download service or account is needed.
Change
Replace site/index.html with the following. The navigation is repeated on purpose for one lesson; next we will move it into a shared layout. These page fragments use the starter's existing document wrapper.
<what>
title = "My website"
</what>
<nav aria-label="Main navigation">
<a href="/">Home</a>
<a href="/about">About</a>
<a href="/contact">Contact</a>
</nav>
<main>
<h1>My website</h1>
<p>I am building my own website.</p>
<p>A small place for ideas, projects and useful things.</p>
<figure>
<img src="/static/images/site-image.svg" width="640" height="360"
alt="An open notebook and a green plant on a sunlit desk"
style="max-width: 100%; height: auto;">
<figcaption>A little space to make something of your own.</figcaption>
</figure>
</main>
Create site/about.html and site/contact.html with these complete contents:
<what>
title = "About | My website"
</what>
<nav aria-label="Main navigation">
<a href="/">Home</a>
<a href="/about">About</a>
<a href="/contact">Contact</a>
</nav>
<main>
<h1>About this website</h1>
<p>This is a place to share what I am learning and making.</p>
<p>I started with one page. Now every new page has a home.</p>
</main>
<what>
title = "Contact | My website"
</what>
<nav aria-label="Main navigation">
<a href="/">Home</a>
<a href="/about">About</a>
<a href="/contact">Contact</a>
</nav>
<main>
<h1>Contact</h1>
<p>Have a question or an idea to share?</p>
<p>This sample page is ready for your contact details. Replace this paragraph with the way you prefer people to reach you.</p>
</main>
Create the folder static/images/, then create static/images/site-image.svg. Copy this entire image source:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 360" width="640" height="360">
<rect width="640" height="360" rx="20" fill="#f2eadb"/>
<circle cx="520" cy="82" r="45" fill="#eab86a"/>
<path d="M0 282H640V360H0Z" fill="#cba87e"/>
<path d="M92 120Q172 92 256 120V274Q172 246 92 274Z" fill="#fffdf8"/>
<path d="M256 120Q340 92 420 120V274Q340 246 256 274Z" fill="#fffdf8"/>
<path d="M256 120V274M116 150Q174 132 232 150M116 180Q174 162 232 180M280 150Q338 132 396 150M280 180Q338 162 396 180" fill="none" stroke="#b9ad94" stroke-width="4"/>
<path d="M476 232H556L544 282H488Z" fill="#a85f3b"/>
<path d="M516 234V136" stroke="#4d7655" stroke-width="7"/>
<path d="M516 186Q462 184 472 142Q514 146 516 186M516 162Q562 160 556 120Q516 122 516 162M516 214Q560 214 564 174Q520 172 516 214" fill="#66865b"/>
</svg>
The image's alt describes what it shows. Its width and height reserve space before it loads; the small inline style lets it shrink on a narrow screen. The next lesson will move shared styling into your stylesheet.
Check
- Open /, /about, and /contact. Reload each URL directly. The headings should be “My website,” “About this website,” and “Contact.”
- On Home, the notebook-and-plant image should appear. Open the image URL separately if it does not.
- Press Tab to reach Home, About, and Contact, then Enter to follow a link. Narrow the browser and confirm the image stays inside the page.
- Visit /does-not-exist and a missing image. Both should return a missing-file response, not homepage content.
Do not continue until all three real pages and the real image work.
Recover
These are anticipated learner mistakes; the replay checks the corresponding missing-route and missing-asset behavior.
- A page is missing: check its exact filename, including lowercase spelling. It belongs in
my-site/site/, alongsideindex.html. - The image is missing: compare
src="/static/images/site-image.svg"with the file's location. The leading slash starts at this website's root. - Changes appear in the wrong website: stop the server and restart
run-what devfrom this project's folder. Use its printed address if you changed the port.
If you need a clean comparison, download the L01 source checkpoint for this lesson. It is a copy of the project at this point, not a separately installed template. It contains source files and a checksum manifest; it excludes sessions and runtime databases. Keep your project and extract into a new folder. For example, after placing that archive in Downloads, stop your dev server and run these commands from the folder that contains my-site:
mkdir my-site-recovery-L01 && unzip -n "$HOME/Downloads/L01.zip" -d my-site-recovery-L01
If the folder already exists, the first command fails and extraction does not run. Pick another new name; do not empty an existing folder. After successful extraction:
cd my-site-recovery-L01
run-what dev
Reapply this lesson there. Optional exercises are not part of the required checkpoint; keep your own variations in your original project.
Try
Optional: create site/services.html with a “Services” heading, then add a /services link to the navigation. Check that you can open the new URL directly. The next lesson requires only Home, About and Contact; you can apply its shared layout to your extra page too.
Continue
You can now build a small information site with ordinary pages, links and local assets. Next, share the layout, metadata and styling so one edit updates every page.