feat: use the first paragraph as the excerpt if description is not set

This commit is contained in:
saicaca
2024-08-03 16:03:03 +08:00
parent 9af6cf956a
commit 1f93499ece
3 changed files with 20 additions and 3 deletions

View File

@@ -17,6 +17,7 @@ import { AdmonitionComponent } from "./src/plugins/rehype-component-admonition.m
import { GithubCardComponent } from "./src/plugins/rehype-component-github-card.mjs"
import {parseDirectiveNode} from "./src/plugins/remark-directive-rehype.js";
import { remarkReadingTime } from "./src/plugins/remark-reading-time.mjs"
import {remarkExcerpt} from "./src/plugins/remark-excerpt.js";
const oklchToHex = (str) => {
const DEFAULT_HUE = 250
@@ -68,7 +69,7 @@ export default defineConfig({
}),
],
markdown: {
remarkPlugins: [remarkMath, remarkReadingTime, remarkGithubAdmonitionsToDirectives, remarkDirective, parseDirectiveNode],
remarkPlugins: [remarkMath, remarkReadingTime, remarkExcerpt, remarkGithubAdmonitionsToDirectives, remarkDirective, parseDirectiveNode],
rehypePlugins: [
rehypeKatex,
rehypeSlug,