You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
318 B
13 lines
318 B
2 years ago
|
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;
|
||
|
}
|
||
|
});
|
||
|
};
|
||
|
}
|