mirror of
https://github.com/discordjs/discord.js.git
synced 2024-07-16 04:47:40 +12:00
Update apps/guide/contentlayer.config.ts
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
This commit is contained in:
parent
0a2c912421
commit
be1b2ea6cd
|
@ -41,12 +41,11 @@ export const Content = defineDocumentType(() => ({
|
|||
const slugger = new GithubSlugger();
|
||||
// @ts-expect-error TypeScript can't infer
|
||||
return Array.from(doc.body.raw.matchAll(regXHeader)).map(({ groups }) => {
|
||||
const flag = groups?.flag;
|
||||
const content = groups?.content;
|
||||
return {
|
||||
level: flag?.length,
|
||||
level: groups?.flag?.length,
|
||||
text: content,
|
||||
slug: content ? slugger.slug(content) : undefined,
|
||||
slug: content && slugger.slug(content),
|
||||
};
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue