Creating a Page
A page is a template file, .ets or .md, anywhere in pb_pages/. Its path becomes its URL. (A .tsx component works too; see File types.)
Creating pages
- Create a file: inside
pb_pages/, create an.etsfile. For example, an "About" page:
pb_pages/about.ets -> serves "/about"
indexfiles:indexmaps to its folder.
pb_pages/index.ets -> serves "/"
pb_pages/products/index.ets -> serves "/products" (and "/products/")
- Nested pages: folders become URL segments.
pb_pages/
├── index.ets -> "/"
├── about.ets -> "/about"
├── contact.ets -> "/contact"
└── products/
├── index.ets -> "/products"
└── details.ets -> "/products/details"
- Markdown pages: a
.mdfile works the same way. Its tags run first (plain JavaScript), then Markdown. See Markdown.
pb_pages/docs/routing.md -> "/docs/routing"
The extension is always dropped from the URL. To add data or handle forms, put a .ts file with the same name next to the page (about.ts beside about.ets); see Loading Data.
Questions and comments
Comments are a GitHub Discussions thread; sign in with GitHub to post.