fix: fix errors and reformat code

This commit is contained in:
saicaca
2024-08-03 16:40:20 +08:00
parent 1f93499ece
commit 0ad144add3
44 changed files with 550 additions and 558 deletions

View File

@@ -2,15 +2,15 @@ import { toString } from 'mdast-util-to-string'
/* Use the post's first paragraph as the excerpt */
export function remarkExcerpt() {
return (tree, { data }) => {
let excerpt = '';
for (let node of tree.children) {
if (node.type !== 'paragraph') {
continue
}
excerpt = toString(node)
break
}
data.astro.frontmatter.excerpt = excerpt
};
}
return (tree, { data }) => {
let excerpt = ''
for (let node of tree.children) {
if (node.type !== 'paragraph') {
continue
}
excerpt = toString(node)
break
}
data.astro.frontmatter.excerpt = excerpt
}
}