reindex
Rebuild the content index by scanning all content files and writing .content-ops/content-index.json. Use after bulk content changes, migrations, or when the user asks to reindex.
Reindex Content
Rebuild the content index by scanning all content files, extracting frontmatter, and writing .content-ops/content-index.json. No MCP, no embeddings, no API calls.
When to use
- After initial plugin setup (first-time index)
- After bulk content edits or migrations
- After creating or modifying articles or glossary entries
- When the user explicitly asks to reindex
Procedure
-
Read config from
.content-ops/config.md:content_types— each type'spath(e.g.,article.path,glossary.path)languages— list of language codes to scancontent_index_path
-
Scan content directories for each content type and language:
- Use Glob to find all
.mdand.mdxfiles under{type.path}/{lang}/ - For each file: Read it and extract frontmatter only (the YAML between
---delimiters). Do not include the body.
- Use Glob to find all
-
Build the index structure — use the stable minimal schema for every entry (all content types):
Per entry:
slug: filename without extensionpath: relative path to file (for traceability and linking edits)type: content type key (e.g.article,glossary)lang: language code from directorytitle: articles → frontmattertitle; glossary → frontmattertermexcerpt: articles → frontmatterexcerpt; glossary → frontmatterdefinition(first 1–2 sentences)tags: from frontmatter if present (default[])translationKey: from frontmatter if present (omit if absent)
-
Write the JSON file to
content_index_pathfrom config:
{
"generated_at": "<ISO 8601 timestamp>",
"config_fingerprint": {
"default_language": "<from config>",
"languages": ["<from config>"],
"content_types": { "article": { "path": "..." }, "glossary": { "path": "..." } }
},
"content": {
"article": { "en": [...], "it": [...] },
"glossary": { "en": [...], "it": [...] }
}
}
-
Ensure the directory exists: If
.content-ops/does not exist, create it before writing. -
Report results: List how many items were indexed per type and language.
Important notes
- This process only reads files and writes JSON. No external APIs or MCP tools.
- Items with missing or invalid frontmatter should be reported but should not stop the overall process.
- Re-indexing is idempotent — running again overwrites the index with current content.