How to Publish Your First Landing Page with the LitPage CLI
Connect the LitPage CLI to a site, create a landing page from YAML, and verify the version your visitors can open.
Start with a new site or reuse one you can edit. This tutorial uses CLI 0.7.0. You will make a small landing page from a local YAML file, preview it in Builder, and publish the draft you reviewed. At the end, you will have a URL you can open in a private browser window and a receipt identifying the published revision.
Set up access and choose your site
Follow set up the CLI and connect a site. For a new site, create a Workspace Key with Allow website creation, then choose an available subdomain.
npx @litpage/cli doctor
npx @litpage/cli site create --subdomain your-site --name "Workshop"
npx @litpage/cli site init --subdomain your-site
The last command publishes the new site's default header and footer. For an existing site, run npx @litpage/cli site resolve your-site to confirm the destination and check that its shared navigation is published.
Create the page file
Use the block commands to get a real authoring example. They run locally, so you can inspect a schema and try a variant before contacting the site.
npx @litpage/cli block list
npx @litpage/cli block example PageHeader --variant compact --format yaml
npx @litpage/cli page create --help
To generate a starting file on any shell, run:
npx @litpage/cli page template first-page.page.yaml --slug /first-cli-page --title "Workshop open day"
For a complete example with explicit SEO fields, save the following as first-page.page.yaml. Choose an unused path, and select a language configured on your site. A landing page uses the full path, such as /first-cli-page. A blog post uses a slug under its collection. Use / for a homepage, or page collection for a reserved content index such as /blog.
schemaVersion: 1
slug: /first-cli-page
language: EN
configuration:
pageMetadata:
schemaVersion: 1
title: Workshop open day
description: See what to expect at the studio open day.
seo:
title: Workshop Open Day
description: Learn what visitors can see and do at the studio open day.
ogImage: null
indexable: false
sections:
- id: open-day-intro
type: PageHeader
variant: compact
title: Workshop open day
description: Meet the team and see how we make our ceramics.
Keep ogImage: null if you have no sharing image. This example sets indexable: false for the exercise. The page can still be opened after publication. Set it to true in a new revision when you want a real landing page eligible for indexing. The PageHeader title is the visible heading, while pageMetadata.seo supplies metadata for the published revision.
Save and preview the draft
npx @litpage/cli page validate --file first-page.page.yaml
npx @litpage/cli page create --subdomain your-site --file first-page.page.yaml --out first-page-draft.page.yaml
The command saves a draft. Keep its exported page ID and version fields. In Builder, find the new page under Landing pages and open its preview. Check the heading, the description and the layout on a narrow screen. If you change the draft in Builder, pull its latest state using the page ID before publishing from the terminal.
Publish and verify
Publish the saved draft and inspect the receipt.
npx @litpage/cli page publish --file first-page-draft.page.yaml --out first-page-live.page.yaml
npx @litpage/cli page verify --file first-page-live.page.yaml
The CLI records the operation ID and checks anonymous delivery as part of publish. Read meta.publication and meta.delivery, then open the canonical URL without a Builder session. Run page verify to check delivery again later. If the publish response was lost, retry the same command with the same draft file and CLI state. On a version conflict, pull and review the latest draft before publishing.
Choose your next task
- Update a published landing page to pull a live page, save an edit, and check draft isolation.
- Publish a blog post from the command line if your source is a Markdown article.
- Find CLI commands with help for syntax, required parameters and examples.