|
1 | 1 | import { rehypeHeadingIds } from '@astrojs/markdown-remark'; |
2 | | -// import remarkWikiLink from "@braindb/remark-wiki-link"; |
| 2 | +import remarkWikiLink from "@braindb/remark-wiki-link"; |
3 | 3 | import expressiveCode from 'astro-expressive-code'; |
4 | 4 | import icon from 'astro-icon'; |
5 | 5 | import { defineConfig } from 'astro/config'; |
@@ -89,33 +89,33 @@ export default defineConfig({ |
89 | 89 | markdown: { |
90 | 90 | remarkPlugins: [ |
91 | 91 | remarkMath, |
92 | | - // [ |
93 | | - // remarkWikiLink, |
94 | | - // { |
95 | | - // linkTemplate: ({ slug, alias }) => { |
96 | | - // let normalizedSlug = (slug || '') |
97 | | - // .replace(/^\/\//, '') |
98 | | - // .replace(/^src\/content\//, '') |
99 | | - // .replace(/^\/+/, '') |
100 | | - // .replace(/\.(md|mdx)$/, '') |
101 | | - // .replace(/\/index$/, '') |
| 92 | + [ |
| 93 | + remarkWikiLink, |
| 94 | + { |
| 95 | + linkTemplate: ({ slug, alias }) => { |
| 96 | + let normalizedSlug = (slug || '') |
| 97 | + .replace(/^\/\//, '') |
| 98 | + .replace(/^src\/content\//, '') |
| 99 | + .replace(/^\/+/, '') |
| 100 | + .replace(/\.(md|mdx)$/, '') |
| 101 | + .replace(/\/index$/, '') |
102 | 102 |
|
103 | | - // return { |
104 | | - // hName: 'a', |
105 | | - // hProperties: { |
106 | | - // href: `/${normalizedSlug}`, |
107 | | - // class: 'inner-link not-prose' |
108 | | - // }, |
109 | | - // hChildren: [ |
110 | | - // { |
111 | | - // type: 'text', |
112 | | - // value: alias || normalizedSlug || '' |
113 | | - // } |
114 | | - // ] |
115 | | - // } |
116 | | - // } |
117 | | - // } |
118 | | - // ], |
| 103 | + return { |
| 104 | + hName: 'a', |
| 105 | + hProperties: { |
| 106 | + href: `/${normalizedSlug}`, |
| 107 | + class: 'inner-link not-prose' |
| 108 | + }, |
| 109 | + hChildren: [ |
| 110 | + { |
| 111 | + type: 'text', |
| 112 | + value: alias || normalizedSlug || '' |
| 113 | + } |
| 114 | + ] |
| 115 | + } |
| 116 | + } |
| 117 | + } |
| 118 | + ], |
119 | 119 | remarkBreaks, |
120 | 120 | remarkMermaid, |
121 | 121 | // remarkAiNotice |
|
0 commit comments