Creating a PocketPages Page

A page is a template file, .ejs or .md, anywhere in pb_pages/. Its path becomes its URL.

Creating pages

  1. Create a file: inside pb_pages/, create an .ejs file. For example, an "About" page:
pb_pages/about.ejs  -> serves "/about"
  1. index files: index maps to its folder.
pb_pages/index.ejs           -> serves "/"
pb_pages/products/index.ejs  -> serves "/products" (and "/products/")
  1. Nested pages: folders become URL segments.
pb_pages/
├── index.ejs         -> "/"
├── about.ejs         -> "/about"
├── contact.ejs       -> "/contact"
└── products/
    ├── index.ejs     -> "/products"
    └── details.ejs   -> "/products/details"
  1. Markdown pages: a .md file 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.