docs: fix duplicated desc (#41217)
* docs: fix duplicated desc * fix: use remark plugin * chore: fix ghost deps * chore: better assign * chore: use regexp * chore: remove try catchpull/41234/head^2
parent
d196c7a87b
commit
5c0bc214cc
@ -0,0 +1,12 @@
|
||||
import { unistUtilVisit } from 'dumi';
|
||||
|
||||
export default function remarkMeta() {
|
||||
return (tree, vFile) => {
|
||||
// read frontmatter
|
||||
unistUtilVisit.visit(tree, 'yaml', (node) => {
|
||||
if (!/(^|[\n\r])description:/.test(node.value)) {
|
||||
vFile.data.frontmatter.__autoDescription = true;
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue