Creating a PocketPages Page
A page is a template file, .ejs or .md, anywhere in pb_pages/. Its path becomes its URL.
Creating pages
- Create a file: inside
pb_pages/, create an.ejsfile. For example, an "About" page:
pb_pages/about.ejs -> serves "/about"
indexfiles:indexmaps to its folder.
pb_pages/index.ejs -> serves "/"
pb_pages/products/index.ejs -> serves "/products" (and "/products/")
- Nested pages: folders become URL segments.
pb_pages/
├── index.ejs -> "/"
├── about.ejs -> "/about"
├── contact.ejs -> "/contact"
└── products/
├── index.ejs -> "/products"
└── details.ejs -> "/products/details"
- Markdown pages: a
.mdfile works the same way. It runs through EJS first, 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 +page.js next to the page; see Loading Data.