mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 11:08:45 +08:00
16 lines
413 B
TypeScript
16 lines
413 B
TypeScript
import { unistUtilVisit } from 'dumi';
|
|
import 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;
|