You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design/.dumi/remarkAntd.ts

15 lines
390 B
TypeScript

import { unistUtilVisit, type UnifiedTransformer } from 'dumi';
function remarkMeta(): UnifiedTransformer<any> {
return (tree, vFile) => {
// read frontmatter
unistUtilVisit.visit(tree, 'yaml', (node) => {
if (!/(^|[\n\r])description:/.test(node.value)) {
(vFile.data.frontmatter as any).__autoDescription = true;
}
});
};
}
export default remarkMeta;