diff --git a/plugs/core/tags.ts b/plugs/core/tags.ts index d2089cd..fb59a0a 100644 --- a/plugs/core/tags.ts +++ b/plugs/core/tags.ts @@ -6,6 +6,7 @@ import type { QueryProviderEvent, } from "$sb/app_event.ts"; import { applyQuery, removeQueries } from "$sb/lib/query.ts"; +import { extractFrontmatter } from "../../plug-api/lib/frontmatter.ts"; // Key space // tag:TAG => true (for completion) @@ -13,6 +14,10 @@ import { applyQuery, removeQueries } from "$sb/lib/query.ts"; export async function indexTags({ name, tree }: IndexTreeEvent) { removeQueries(tree); const allTags = new Set(); + const { tags } = extractFrontmatter(tree); + if (Array.isArray(tags)) { + tags.forEach((t) => allTags.add(t)); + } collectNodesOfType(tree, "Hashtag").forEach((n) => { allTags.add(n.children![0].text!.substring(1)); }); diff --git a/website/CHANGELOG.md b/website/CHANGELOG.md index b3724e7..abfdb48 100644 --- a/website/CHANGELOG.md +++ b/website/CHANGELOG.md @@ -3,6 +3,13 @@ release. --- +## Next + +* Tags included in `tags` [[Frontmatter]] now included in hash tag auto complete +* Regression fix: when instantiating a page from a template it would always claim the page already existed (even if it didn't) + +--- + ## 0.2.12 * Added support to override CSS styles on a per-space basis. This replaces the previous `fontFamily` setting. See [[STYLES]] for hints on how to use this new experimental feature.