Markdown File Configuration Reference
🕒 Reading time: 4 min📝 Words: 868👀 Views: Loading...
In this article
This article is rewritten according to the current schema (see src/schemas/collections.ts), listing the frontmatter requirements and examples for posts, about, and words. Avoid using project-internal relative links to ensure no broken links when published to the site.
Overview
This article is rewritten according to the current schema (see src/schemas/collections.ts), listing the frontmatter requirements and examples for posts, about, and words. Avoid using project-internal relative links to ensure no broken links when published to the site.
posts/*.md frontmatter
Loader: base is stalux/posts/, pattern *.md/*.mdx.
Required fields:
title: Post title.desc: Non-empty post summary, used by metadata, previews and agent tools.abbrlink: Permanent link, supports strings or numbers (numbers are automatically converted to strings). It is recommended to manually set this to keep URLs stable.date: Publish time, string type, recommended formatYYYY-MM-DD HH:mm:ss, must be wrapped in double quotes to prevent YAML from automatically converting it to a Date object.
Optional fields:
updated: Update date, string type, same format asdate, also needs double quotes. If not provided, the update time will not be displayed.draft: Boolean, default false; drafts are excluded from published pages, indexes and Markdown exports.tags: Tag array; a string or single string will be preprocessed into an array.categories: Category array; a string or single string will be preprocessed into an array.cc: Copyright license, defaultCC-BY-NC-SA-4.0.cover: Optional article-list image and article structured-data image.og:image: Optional HTTP(S) URL or site-root path for sharing. The author avatar is used by default.
Example:
---title: Astro Getting Started Guidedesc: A practical guide to starting an Astro blog.abbrlink: astro-guidedate: "2025-05-10 09:30:00"updated: "2025-05-12 18:00:00"tags: - Astro - Frontendcategories: - Tech Tutorialcc: CC-BY-NC-SA-4.0draft: false---
Body content...Writing tips:
- Recommended date format:
YYYY-MM-DD HH:mm:ss(e.g.,"2025-05-10 09:30:00"). - Must be wrapped in double quotes, otherwise YAML will automatically convert it to a Date object, causing schema validation to fail.
abbrlinkcan be a string (e.g.,"astro-guide") or a number (e.g.,123456); numbers are automatically converted to strings.tags/categoriessupport a single string or an array; they are automatically converted to arrays internally.- If
ccis not provided, the default valueCC-BY-NC-SA-4.0is used; if no copyright notice is needed, it can be set to an empty string.
Article social sharing images
Set avatar in stalux/config/author.yml for the default Open Graph and Twitter image. To override it for one article, set og:image in that article’s frontmatter. Use a publicly accessible image.
about/*.md frontmatter
Loader: base is stalux/about/, pattern **/*.{md,mdx}.
Fields:
titleis required.descriptionis required (used for page description/SEO).
Example:
---title: About the Authordescription: Personal introduction, skills, and contact information---
Here is the about page body...words/*.md frontmatter
Loader: base is stalux/words/, pattern *.md/*.mdx.
All fields are optional:
source: Source or author name.link: Source link; when present,sourcewill render as a clickable external link.sourceDate: The date associated with the source, displayed in italics at the bottom-right of the card.date: The date this quote was written, displayed at the bottom-left of the card and used for sorting; same format as posts’date.updated: Update date, string, same format asdate.draft: Boolean, defaultfalse; whentrue, not displayed.
Example:
---source: "Quake III Arena"link: "https://en.wikipedia.org/wiki/Fast_inverse_square_root"sourceDate: "1999"date: "2026-06-18 20:45:00"updated: "2026-06-18 21:00:00"draft: false---
Talk is cheap. Show me the `code`.promote.yml: Markdown Export (export_md)
Field in stalux/config/promote.yml:
export_md: Boolean, defaultfalse. Markdown export is opt-in: only a stricttruegenerates.mdroutes for the home page, posts, about, words, links, archives, categories, and tags.
Published article endpoints use Content-Type: text/markdown. Frontmatter is serialized from the collection metadata through a YAML Document AST; the Markdown body is preserved and a copyright footer is appended. This is a content-equivalent export, not a byte-for-byte copy of the source file. List and taxonomy endpoints render Markdown summaries.
Example:
id: promoteexport_md: trueNote:
export_mdis a site-level opt-in config, not a per-article frontmatter field.- When disabled or omitted, no
.mdexport files are generated. - Only non-draft articles get post
.mdendpoints. - When
promote.export_mdistrue, published post.mdendpoints are included in the sitemap. Other Markdown mirrors remain excluded by default. - Browser WebMCP reads this export when available, or falls back to Orama indexed plain text when export is disabled. Disabling both sources prevents full article reads.
Writing and Validation
- Place frontmatter at the top of the file, wrapped in three dashes.
- Leave a space after colons, maintain correct indentation for arrays/objects.
- After saving, run
bun run dev; if any required fields are missing or types don’t match, the build log will indicate the specific fields.
Markdown File Configuration Reference
Author: xingwangzhe
Article link: https://stalux.needhelp.icu/posts/f31dae4f/
This article is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.