mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-01 06:28:14 +00:00
nested tag support and tag index page
This commit is contained in:
parent
c0278a8c65
commit
cee2883c08
13 changed files with 125 additions and 37 deletions
quartz/plugins/transformers
|
@ -2,7 +2,7 @@ import matter from "gray-matter"
|
|||
import remarkFrontmatter from "remark-frontmatter"
|
||||
import { QuartzTransformerPlugin } from "../types"
|
||||
import yaml from "js-yaml"
|
||||
import { slug as slugAnchor } from "github-slugger"
|
||||
import { slugTag } from "../../path"
|
||||
|
||||
export interface Options {
|
||||
language: "yaml" | "toml"
|
||||
|
@ -43,7 +43,7 @@ export const FrontMatter: QuartzTransformerPlugin<Partial<Options> | undefined>
|
|||
}
|
||||
|
||||
// slug them all!!
|
||||
data.tags = data.tags?.map((tag: string) => slugAnchor(tag)) ?? []
|
||||
data.tags = data.tags?.map((tag: string) => slugTag(tag)) ?? []
|
||||
|
||||
// fill in frontmatter
|
||||
file.data.frontmatter = {
|
||||
|
|
|
@ -9,7 +9,7 @@ import path from "path"
|
|||
import { JSResource } from "../../resources"
|
||||
// @ts-ignore
|
||||
import calloutScript from "../../components/scripts/callout.inline.ts"
|
||||
import { FilePath, canonicalizeServer, pathToRoot, slugifyFilePath } from "../../path"
|
||||
import { FilePath, canonicalizeServer, pathToRoot, slugTag, slugifyFilePath } from "../../path"
|
||||
|
||||
export interface Options {
|
||||
comments: boolean
|
||||
|
@ -337,7 +337,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
|
|||
|
||||
return {
|
||||
type: "link",
|
||||
url: base + `/tags/${slugAnchor(tag)}`,
|
||||
url: base + `/tags/${slugTag(tag)}`,
|
||||
data: {
|
||||
hProperties: {
|
||||
className: ["tag-link"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue