Skip to content

Frontmatter

Frontmatter is YAML metadata at the top of a markdown file, enclosed by --- delimiters. Lokus parses frontmatter for Bases, filtering, sorting, and display in the editor.

---
title: My Note
tags: [project, draft]
date: 2026-02-22
---
Note content starts here.

The opening --- must be the first line of the file. The closing delimiter can be --- or ....

TypeExampleNotes
Stringtitle: My NoteQuotes optional unless value contains :, #, or newlines
Numberpriority: 3Integer or float
Booleandraft: truetrue or false
Datedate: 2026-02-22ISO 8601 format (YYYY-MM-DD) auto-detected
Array (inline)tags: [a, b, c]Inline arrays for 5 or fewer items
Array (block)See belowMulti-line - item syntax for longer lists
Nullvalue: nullOr omit the value entirely
ObjectSee belowNested key-value pairs
tags:
- project
- draft
- important
- review
- archive
- reference
metadata:
author: Jane
version: 2

These fields are recognized by Lokus features (Bases, search, graph, daily notes). You can add any custom field — Lokus reads all valid YAML properties.

FieldTypeDescriptionUsed By
titleStringNote title (overrides filename)Bases, Graph, Search
tagsArrayCategorization tagsBases, Tag Manager, Filtering
dateDateCreation or publication dateBases, Sorting, Daily Notes
createdDateWhen the note was createdBases, Sorting
modifiedDateLast modification dateBases, Sorting
aliasesArrayAlternative names for WikiLink resolutionWikiLinks, Search
descriptionStringShort summarySearch, Bases
draftBooleanMark note as draftFiltering
statusStringWorkflow status (e.g., todo, done)Bases, Kanban
priorityString/NumberPriority levelBases, Sorting
categoryStringNote categoryBases, Filtering
authorStringAuthor nameBases
cssclassStringCustom CSS class applied to the noteEditor styling
publishBooleanWhether the note should be publishedFiltering

Bases (database views) automatically scan frontmatter across all files in a folder. Every unique frontmatter key becomes a filterable, sortable column.

Lokus auto-detects types from values:

Value PatternDetected Type
true / falseBoolean
123, 3.14Number
2026-02-22 (ISO date)Date
[a, b, c]Array
"quoted" or 'quoted'String
Everything elseString

In a Base view, filter notes by frontmatter:

FilterMatches
status == "done"Notes with status done
priority > 2Notes with priority above 2
tags contains "project"Notes tagged with project
draft == falseNon-draft notes
date > 2026-01-01Notes dated after Jan 1, 2026

Edit frontmatter directly as YAML text at the top of any note.

The FrontmatterWriter class provides methods to update frontmatter without manual text editing:

MethodDescription
updateProperty(content, key, value)Add or update a property
removeProperty(content, key)Remove a property
ensureFrontmatter(content, properties)Add frontmatter block if missing
getProperties(content)Read all properties

When Lokus writes frontmatter values:

Value TypeOutput Format
String with special chars"quoted with escapes"
String resembling bool/number"true", "42" (quoted)
Array (5 items or fewer)[a, b, c] (inline)
Array (6+ items)Multi-line - item format
Empty array[]
Empty object{}
Date objectISO 8601 string
nullEmpty value

Lokus converts property formats from other note-taking apps during import:

Source AppSource FormatConverted To
Logseqproperty:: valueYAML frontmatter
Roam Researchattribute:: valueYAML frontmatter
ObsidianYAML frontmatterKept as-is

Frontmatter parsing fails gracefully. If the YAML is invalid, Lokus treats the file as having no frontmatter rather than showing an error. The raw text remains untouched.

Common issues:

ProblemFix
Missing closing ---Add the closing delimiter
Tab characters in YAMLReplace tabs with spaces
Unquoted special charactersWrap value in quotes: "value: with colon"
Missing space after colonAdd space: key: value not key:value