Skip to content

Commit

Permalink
don't create excerpt if the content starts with a code block
Browse files Browse the repository at this point in the history
  • Loading branch information
yshrsmz committed Oct 12, 2024
1 parent c47985e commit 7df8c5c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/blog/.vitepress/theme/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ export function createExcerpt(content: string): string | undefined {
return undefined
}

if (excerpt?.startsWith('```')) {
return undefined
}

return `${excerpt}…`
}

Expand Down

0 comments on commit 7df8c5c

Please sign in to comment.