actually add processed tag to frontmatter

This commit is contained in:
Jacky Zhao 2023-07-24 00:07:58 -07:00
parent f66aa378a9
commit 9701313bf3

View File

@ -331,6 +331,10 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
const slug = canonicalizeServer(file.data.slug!) const slug = canonicalizeServer(file.data.slug!)
const base = pathToRoot(slug) const base = pathToRoot(slug)
findAndReplace(tree, tagRegex, (value: string, tag: string) => { findAndReplace(tree, tagRegex, (value: string, tag: string) => {
if (file.data.frontmatter) {
file.data.frontmatter.tags.push(tag)
}
return { return {
type: "link", type: "link",
url: base + `/tags/${slugAnchor(tag)}`, url: base + `/tags/${slugAnchor(tag)}`,