Writing Content

Every page is a .crv file with optional YAML frontmatter followed by Carve content.

Frontmatter Reference

KeyTypeDefaultEffect
titlestringfirst H1 or pathPage title and search title.
descriptionstringsite descriptionMeta description and social description.
layoutstring'doc'Selects doc, page, home, blog, or a custom layout.
heroobjectnoneHome layout hero data.
featuresarraynoneHome layout feature cards.
headhead tuple array[]Extra tags for this page.
imagestringnoneSocial image URL.
ogImagestringnoneAlias used when image is absent.
redirectFromstring | string[]noneOld routes that redirect to this page.
outlinefalse | number | [number, number] | 'deep'site outlinePer-page outline level.
asidefalsevisibleHides the outline.
sidebarfalsevisible when matchedHides the sidebar.
prevfalse | { text: string; link: string }computedFooter previous link override.
nextfalse | { text: string; link: string }computedFooter next link override.
editLinkfalsevisible when configuredHides the edit link.
lastUpdatedfalsevisible when configuredHides the timestamp.
ordernumbertitle sortSort key for generated sidebars.
draftbooleanfalseDraft pages are excluded from public derived outputs.
datestringrequired for blog postsBlog and feed date.
tagsstring[][]Blog tag pages.
excerptstringdescription or first proseBlog listing and feed summary.
authorstring | string[]noneBlog post byline.
virtualbooleaninternalMarks generated pages.

Includes

Include directives are comments, so they render nothing after expansion:

include a snippet
%% @include: ./snippets/install.crv

This page includes one real line from a shared snippet:

Install with npm install --save-dev @markup-carve/carve-press.

You can include a range with {2,4}, an open range with {2,}, or a heading section with #heading-id.

Cross-References

Use heading attributes on the line above the heading, then reference them with </#id>.

Cross-Reference Target

This sentence links back to Cross-Reference Target. Reference links also work: Cross-Reference Target.

Redirects From Old Routes

Use redirectFrom on the page that replaced an old URL:

frontmatter
redirectFrom:
  - /old-guide/
  - /install

Each source must start with /, must not contain .. segments, and must not collide with a real page or another redirect source. Draft pages do not emit their redirectFrom entries.

Substitutions

Values that appear across many pages - a supported version, a package name - can live in the config instead of in forty files:

carve-press.config.ts
substitutions: {
  enginever: { value: '0.1.0', format: 'code' },
  minnode: '20',
}

Write the key wrapped in pipes and the build replaces it: this site is built with carve-js 0.1.0 and needs Node 20 or newer. A format of bold, italic, or code wraps the value; the default is plain text.

Substitution runs on the parsed document, not on the source text, so a token inside a fence or an inline code span stays literal - which is how this page can show |enginever| while explaining it. An unknown token is left alone and warned about once per build, because a typo should be visible without making every sentence containing a pipe fatal.

Edit this page

Last updated