website: add icons for home page list.

This commit is contained in:
jaywcjlove
2022-09-30 14:15:26 +08:00
parent c8530f6ca9
commit 410c8f09da
21 changed files with 107 additions and 2 deletions

View File

@ -1,5 +1,5 @@
export function rehypeUrls(node) {
if (node.type === 'element' && node.properties.href && /.md/.test(node.properties.href) && !/^(https?:\/\/)/.test(node.properties.href)) {
if (node.type === 'element' && node.properties?.href && /.md/.test(node.properties.href) && !/^(https?:\/\/)/.test(node.properties.href)) {
let href = node.properties.href;
node.properties.href = href.replace(/([^\.\/\\]+)\.(md|markdown)/gi, '$1.html');
}