Markspresso Docs
Site structure and configuration
Site structure and configuration
Markspresso expects a simple, conventional directory layout. You can customize it via markspresso.json.
Default layout
When you run lucli markspresso create, your site root is populated with:
markspresso.json– main configuration filecontent/– Markdown contentindex.md– home pageposts/hello-world.md– starter post
layouts/– HTML layout templatespage.html– default page layoutpost.html– default post layoutpartials/– shared partial templates for header, footer, etc.
assets/– static files (CSS, images, JS) copied as-is into the build outputpublic/– output directory for generated HTML
You can move these around by editing markspresso.json.
markspresso.json schema
A minimal config looks like this:
{
"name": "My Site",
"baseUrl": "http://localhost:8080",
"theme": "default",
"paths": {
"content": "content",
"layouts": "layouts",
"assets": "assets",
"output": "public"
},
"build": {
"defaultLayout": "page",
"prettyUrls": true,
"includeDrafts": false,
"latestPostsCount": 5
},
"collections": {
"posts": {
"path": "posts",
"layout": "post",
"permalink": "/posts/:slug/"
}
}
}
theme
theme– active theme name used by the builder (default:default)
Theme lookup order is:
<site-root>/themes/<theme-name>/- module-level
themes/<theme-name>/
If no matching theme is found, Markspresso falls back to site-local layouts/assets.
paths
content– where Markspresso looks for Markdown fileslayouts– where it looks for layout templatesassets– copied recursively into the output directoryoutput– where generated HTML is written
build
defaultLayout– name of the layout used when a document does not specifylayoutin front matterprettyUrls– iftrue, non-index pages are written topath/to/page/index.htmlinstead ofpath/to/page.htmlincludeDrafts– iftrue, includedraft: truedocs even without the--draftsflaglatestPostsCount– how many latest posts to inject into the home page as{{ latest_posts }}
collections
Collections group related content under a subdirectory and layout.
Each collection entry has:
path– subdirectory undercontent/layout– layout name to use by defaultpermalink– pattern for canonical URLs;:slugis replaced with the document slug
The default posts collection maps to content/posts/ and uses the post layout.
Optional navigation config
If you want your navigation to only include a subset of content (for example, everything under content/docs), you can add a navigation block:
{
"navigation": {
"rootPath": "docs"
}
}
When rootPath is set, navigation will only be built from documents whose relative paths start with docs/.
Overriding paths with CLI flags
CLI flags can temporarily override configuration values:
lucli markspresso build --src=docs– treatdocs/as the content rootlucli markspresso build --out=dist– write HTML intodist/
These do not modify markspresso.json; they just affect the current build.
Search and Lunr
Markspresso can generate a client-side search index for your site and wire it up to a Lunr.js search UI. This is controlled via the optional search block in markspresso.json:
{
"search": {
"lunr": {
"enabled": true,
"dataJs": "js/markspresso-search-data.js",
"searchJs": "js/markspresso-search.js"
}
}
}
When search.lunr.enabled is true:
- The Markspresso build will scan all generated documents, extract plain-text content and titles, and write a JSON-backed data file to the
search.lunr.dataJslocation (relative to yourpaths.outputdirectory). This file defineswindow.MarkspressoSearchDocs– an array of{ url, title, body }objects. - The bundled
resources/utility/markspresso-search.jsscript is copied tosearch.lunr.searchJsunder your output directory and loaded viain your layout. - The browser script will automatically load Lunr.js from the CDN (
https://unpkg.com/lunr/lunr.js), build an in-memory index fromwindow.MarkspressoSearchDocs, and wire up a simple search UI.
You can customize the output locations by changing search.lunr.dataJs and search.lunr.searchJs if you want to serve the search assets from a different directory.
On the layout side, the search scripts are exposed via a markspressoScripts token/variable – see Search UI and markspressoScripts for how to add the corresponding <input> and results container to your templates.