Skip to content

Commit 1b7f8d3

Browse files
chore: fix conflicts
1 parent 7397c00 commit 1b7f8d3

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

apps/sim/lib/blog/registry.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from 'fs/promises'
22
import path from 'path'
33
import { cache } from 'react'
4-
import { slug as githubSlug } from 'github-slugger'
4+
import GithubSlugger from 'github-slugger'
55
import matter from 'gray-matter'
66
import { compileMDX } from 'next-mdx-remote/rsc'
77
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
@@ -33,10 +33,6 @@ async function loadAuthors(): Promise<Record<string, any>> {
3333
return authors
3434
}
3535

36-
function slugify(text: string): string {
37-
return githubSlug(text)
38-
}
39-
4036
async function scanFrontmatters(): Promise<BlogMeta[]> {
4137
if (cachedMeta) {
4238
return cachedMeta
@@ -154,14 +150,16 @@ export async function getPostBySlug(slug: string): Promise<BlogPost> {
154150
},
155151
},
156152
})
153+
154+
const slugger = new GithubSlugger()
157155
const headings: { text: string; id: string; level: number }[] = []
158156
const lines = content.split('\n')
159157
for (const line of lines) {
160158
const match = /^(#{2,3})\s+(.+)$/.exec(line.trim())
161159
if (match) {
162160
const level = match[1].length
163161
const text = match[2].trim()
164-
headings.push({ text, id: slugify(text), level })
162+
headings.push({ text, id: slugger.slug(text), level })
165163
}
166164
}
167165
return {

0 commit comments

Comments
 (0)