mirror of
https://github.com/ZetaKebab/quartz.git
synced 2025-06-22 08:44:36 +00:00
nested tag support and tag index page
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { slug as slugAnchor } from "github-slugger"
|
||||
import { slug } from "github-slugger"
|
||||
import { trace } from "./trace"
|
||||
|
||||
// Quartz Paths
|
||||
@ -197,10 +197,30 @@ export function splitAnchor(link: string): [string, string] {
|
||||
return [fp, anchor]
|
||||
}
|
||||
|
||||
export function slugAnchor(anchor: string) {
|
||||
return slug(anchor)
|
||||
}
|
||||
|
||||
export function slugTag(tag: string) {
|
||||
return tag
|
||||
.split("/")
|
||||
.map((tagSegment) => slug(tagSegment))
|
||||
.join("/")
|
||||
}
|
||||
|
||||
export function joinSegments(...args: string[]): string {
|
||||
return args.filter((segment) => segment !== "").join("/")
|
||||
}
|
||||
|
||||
export function getAllSegmentPrefixes(tags: string): string[] {
|
||||
const segments = tags.split("/")
|
||||
const results: string[] = []
|
||||
for (let i = 0; i < segments.length; i++) {
|
||||
results.push(segments.slice(0, i + 1).join("/"))
|
||||
}
|
||||
return results
|
||||
}
|
||||
|
||||
export const QUARTZ = "quartz"
|
||||
|
||||
function _canonicalize(fp: string): string {
|
||||
|
Reference in New Issue
Block a user