What it does
Create or replace one page in the draft. Visitors do not see it until publish_site. Omit source to leave the template. Omit page_css to leave that page's stylesheet. null or "" removes it. Creating a page requires source. Send at least one of source, page_css, title, or settings. If the files, title, and settings match the current draft, nothing is written and the response is the current version with noop true. version.live is true when that version is the one visitors currently see. The HTML is the page; a script only enhances it. Liquid output inside an inline script, an on* attribute, script src, base href, iframe srcdoc or an unquoted attribute is refused; scripts belong in /scripts files, with values passed in data-* attributes. patch_page changes part of a page. Pages load live public data with <script src="/_pagehive/bp.js"></script> and bp.query. Page and template reference: https://pagehive.io/docs/bot-guide.md (section Pages and partials).
Plans
Works on every plan: Free, Basic, Pro and Ultra.
Parameters
| Name | Type | About |
|---|---|---|
site_idrequired | string | The id of the site. list_sites gives the ids of your sites. |
pathrequired | string | The page's address on the site, such as / or /about. |
title | string | The page title, used when the template doesn't set its own. |
source | string | The full page template: HTML with Liquid, optionally starting with a data block between --- lines. |
settings | object | description, and og: { title, description, image, image_alt, site_name, url, type } for link previews. A /path image or url becomes a full address. With no image the Pagehive card shows; image "none" shows none. |
page_css | string or null | CSS for this page only. null removes it. |
message | string | A short note for the version history, like a commit message. |
verbose | boolean | true lists every file and page of the draft. Otherwise the response lists only what this call changed, plus draft totals. |
Example
Call put_page with these arguments:
{
"site_id": "01a1…",
"path": "/about",
"title": "About",
"source": "<!doctype html><html><body>{% include 'header' %}<h1>About us</h1></body></html>"
}
Ids like 01a1… stand for your own. list_sites and list_tables give you the real ones.
Related guides
- Pages and partialsOne page per address, with shared headers and footers.
- Link previews and site iconControl how a link looks on X, Slack and WhatsApp.