mirror of
https://github.com/ZetaKebab/quartz.git
synced 2025-06-22 08:44:36 +00:00
taglist, mermaid
This commit is contained in:
@ -1,7 +1,5 @@
|
||||
import path from 'path'
|
||||
import SlugAnchor from 'github-slugger'
|
||||
|
||||
export const slugAnchor = new SlugAnchor()
|
||||
import { slug as slugAnchor } from 'github-slugger'
|
||||
|
||||
function slugSegment(s: string): string {
|
||||
return s.replace(/\s/g, '-')
|
||||
@ -9,7 +7,7 @@ function slugSegment(s: string): string {
|
||||
|
||||
export function slugify(s: string): string {
|
||||
const [fp, anchor] = s.split("#", 2)
|
||||
const sluggedAnchor = anchor === undefined ? "" : "#" + slugAnchor.slug(anchor)
|
||||
const sluggedAnchor = anchor === undefined ? "" : "#" + slugAnchor(anchor)
|
||||
const withoutFileExt = fp.replace(new RegExp(path.extname(fp) + '$'), '')
|
||||
const rawSlugSegments = withoutFileExt.split(path.sep)
|
||||
const slugParts: string = rawSlugSegments
|
||||
|
Reference in New Issue
Block a user