Posts and pages
Markspresso supports collections of content, with a built-in posts collection suitable for blogs.
The new command
To create new content, use:
lucli markspresso new <type> --title "My title" [--slug my-title]
Where <type> is:
postsโ for blog posts (uses thepostscollection andpostlayout)pageโ for standalone pages that use the defaultpagelayout
Examples:
# New blog post
lucli markspresso new posts --title "Hello world"
# New standalone page
lucli markspresso new page --title "About"
If you omit --slug, Markspresso derives one from the title (lowercase, dashes between words, special characters stripped).
Where files are created
- For
posts, files are created under thepathconfigured for thepostscollection (by defaultcontent/posts/). - For other types (like
page), files are created directly under the content root (by defaultcontent/).
The exact directories are based on markspresso.json:
paths.contentโ content rootcollections.posts.pathโ subdirectory for posts
Filenames for posts
Posts get a date prefix in their filename:
YYYY-MM-DD-slug.md
For example, creating a post titled "Hello world" on 2025-01-15 might produce:
content/posts/2025-01-15-hello-world.md
Markspresso will also derive a date value from the filename if you don't specify one explicitly in front matter.
Generated front matter
When using new, Markspresso writes front matter for you. For posts, this includes:
titleโ from--titlelayoutโ typicallypostdateโ current date (YYYY-MM-DD)draft: trueโ so new posts don't appear until you're ready
For pages, it writes:
titleโ from--titlelayoutโ based onbuild.defaultLayout(usuallypage)
You can edit the resulting file to add more fields like permalink, nav_hidden, or any custom keys.
Publishing drafts
To publish a post created with new:
- Open the generated
.mdfile. - Change
draft: truetodraft: falseor remove the line. - Run a build without
--drafts.
Draft behavior:
- Drafts are skipped by default.
- They are included when:
build.includeDraftsistrueinmarkspresso.json, or- You pass
--draftstolucli markspresso build.
Posts on the home page
The scaffolded content/index.md includes a {{ latest_posts }} placeholder. During build, Markspresso:
- Collects posts from the
postscollection - Sorts them by
date(newest first) - Renders an HTML list of links, limited by
build.latestPostsCount
You can remove or move {{ latest_posts }} to customize where the list of recent posts appears.