--- slug: pages-and-layouts title: Pages and Layouts description: Add routes, nest layouts, and link between pages with the file-based router. category: Learn order: 20 --- ## Files become routes This chapter continues the project from the [Quick Start](/guides/quick-start). Everything inside `src/pages` follows the router's conventions. The starter already contains: - `src/pages/index.tsx` → `/` - `src/pages/about.tsx` → `/about` - `src/pages/_layout.tsx` → the root layout wrapping every page There are two equivalent ways to define a page: a named file (`contact.tsx`) or an index file in a directory (`contact/index.tsx`). Both render at `/contact`. ## Add a page Create `src/pages/contact.tsx`: ```tsx // ./src/pages/contact.tsx import { Link } from 'waku'; export default async function ContactPage() { return (
You can reach us at hello@example.com.
Return homePosts will appear here.