Create Content
create_contentCreate new content items in LightCMS using templates, with support for wikilinks, snippets, hashtags, and Markdown to build structured website pages.
Instructions
Create a new content item. Requires a template_id, title, slug, and the data fields defined by the template.
Workflow:
Call list_templates to find the right template and its field names.
Create the content with data matching those fields.
Call publish_content to make it live (or set published=true here to do both in one step).
Set use_header=true, use_footer=true, use_theme=true for pages that should use the site layout. Always include version_comment to make history readable.
Content data fields support rich markup features:
[[Wikilinks]] and [[Page Title|display text]] — link to other pages by title or path; auto-update when paths change
[[include:snippet-name]] — embed a named snippet inline (reusable callouts, CTAs, disclaimers)
#hashtags — mention #tagname anywhere to automatically tag the page
Markdown fields (type "markdown") — GitHub Flavored Markdown converted to HTML at publish time Templates can use {{.lc_toc}} in their HTML layout to inject an auto-generated table of contents.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | Content category for collections | |
| data | Yes | Template field values,required | |
| folder_path | No | Folder path (e.g., /blog) | |
| meta_description | No | SEO meta description | |
| og_image | No | Open Graph image URL | |
| published | No | Publish immediately | |
| raw_mode | No | Use raw HTML mode | |
| slug | Yes | URL slug for the content,required | |
| tags | No | Tags for lc:query index pages (e.g. ['AI & Machine Intelligence', 'Generative AI']) | |
| template_id | Yes | Template ID (MongoDB ObjectID),required | |
| title | Yes | Content title,required | |
| use_footer | No | Include site footer | |
| use_header | No | Include site header | |
| use_theme | No | Apply site theme/layout | |
| version_comment | No | Optional comment describing this version |