Built in
Collections
A blog, a menu, recipes, a team page, a list of cars: anything made of many items that look alike. Design one item, and pepita renders the rest, each with its own page that search engines and AI can read.
What a collection is
A collection has two halves:
1One layout
<article>
<img src="{{image:photo}}">
<h3>{{title}}</h3>
<p>{{intro}}</p>
</article>2Many items
- Glazed pork noodlesLive
- Ten-minute ramenLive
- Miso aubergineDraft
3Your page
There is no data model to define first. The fields in your layout are the fields of every item, and the form you fill in for each item is drawn from them.
Create a collection
The fastest way is to ask the AI assistant: "add a blog with a list on the home page and a page for each post". It writes the layout, places the collection on your page and creates the item pages.
To do it yourself, open Collections in the editor's left rail, create
one, and write its layout as HTML with {{placeholders}} where each item's content
goes. The look comes from the collection's own style.css, shared by all its layouts.
Adding items
In Collections, open the collection and add an item. You get a form with one box per field: a text box, a longer text area, or an image upload. Every item needs a title, which also makes its address.
Need to add many at once? Your own agent can import a whole list in one go, from a spreadsheet, an old blog or a document. Either all items are added or none are, so there is never a half-finished import.
Drafts and live items
A new item starts as a draft. Drafts show in the editor and on preview links, but not on your live site. Flip the Live/Draft switch on the item's row to publish or unpublish it. That takes effect immediately, with no site publish needed.
Changes to a layout wait until you click Save, so you can rework a design without visitors seeing it half done.
Several layouts
The same items usually appear twice: as a small card in a list, and as the full article on their own page. A collection can have several layouts for that. Add one with New layout. All layouts share the same items, so you write each post once.
Showing it on a page
A collection appears wherever a page has a <pepita-content> tag:
<pepita-content mode="list" name="recipes" variant="card"></pepita-content>mode="list"Every live item, newest first.mode="carousel"The items one at a time, to page through.mode="single"One chosen item, for example a featured recipe on the home page.variantWhich layout to use. Leave it out for the default.An element you write inside the tag is shown once, before the items. Give it
data-every-th="4" and it repeats after every fourth item instead, which suits a
callout or a sign-up box in the middle of a long list.
A page per item
Every item gets its own address, such as /recipes/glazed-pork-noodles-x7k2,
made from its title plus four characters. You don't create a file per item: one page,
recipes/index.html, serves all of them. Inside it, what belongs on one item's page
goes in <pepita-if-slug>, and what belongs on the list goes in
<pepita-if-not-slug>.
This works in the page's <head> too, so each item gets its own
<title> and meta description for search results.
Fields
{{title}}Short text. Every item has a title.{{long:intro}}Longer single-line text.{{mline:body}}Several lines of text.{{image:photo}}An image, uploaded in the item's form.data-eachA repeating group, such as a recipe's ingredients or a product's features. Groups can be nested.Limits
- Up to 1,000 items per collection.
- A page shows at most 100 items. There is no pagination yet.
- Renaming an item changes its address, and the old address isn't redirected automatically. Add a redirect if the old one was shared.
- Item pages aren't yet included in the sitemap that Site Health generates.