mdx extensions, rehype :)

This commit is contained in:
lovebird 2025-03-13 17:04:41 +01:00
parent c4782396f4
commit 194c3a9a16
4 changed files with 8 additions and 15 deletions

File diff suppressed because one or more lines are too long

View File

@ -24,6 +24,7 @@ export function remarkReadingTime() {
/** /**
* @link : https://github.com/rehypejs/rehype/blob/main/doc/plugins.md * @link : https://github.com/rehypejs/rehype/blob/main/doc/plugins.md
* @link : https://tanggd.github.io/en/guides/markdown-content/#configuring-markdown-and-mdx
*/ */
export default defineConfig({ export default defineConfig({
@ -57,7 +58,7 @@ export default defineConfig({
name: 'auto-import-img', name: 'auto-import-img',
transform(code, id) { transform(code, id) {
if (id.endsWith('.astro') || id.endsWith('.mdx')) { if (id.endsWith('.astro') || id.endsWith('.mdx')) {
return `import { Img } from 'imagetools/components';\n` + code; // return `import { Img } from 'imagetools/components';\n` + code;
} }
}, },
}, },
@ -93,14 +94,7 @@ export default defineConfig({
mdx({ mdx({
rehypePlugins: [ rehypePlugins: [
rehypeAccessibleEmojis, rehypeAccessibleEmojis,
remarkReadingTime, remarkReadingTime
toc,
() => {
// All remark and rehype plugins return a separate function
return function (tree, file) {
file.data.astro.frontmatter.customProperty = 'Generated property';
}
}
], ],
}), }),
//AstroPWA({}), //AstroPWA({}),

View File

@ -1,12 +1,12 @@
export default { export default {
"environment": "build", "environment": "dev",
"isSsrBuild": false, "isSsrBuild": false,
"projectBase": "", "projectBase": "",
"publicDir": "C:\\Users\\zx\\Desktop\\polymech\\polymech-site\\public\\", "publicDir": "C:\\Users\\zx\\Desktop\\polymech\\polymech-site\\public\\",
"rootDir": "C:\\Users\\zx\\Desktop\\polymech\\polymech-site\\", "rootDir": "C:\\Users\\zx\\Desktop\\polymech\\polymech-site\\",
"mode": "production", "mode": "dev",
"outDir": "C:\\Users\\zx\\Desktop\\polymech\\polymech-site\\dist\\", "outDir": "dist",
"assetsDir": "_astro", "assetsDir": "/_astro",
"sourcemap": false, "sourcemap": false,
"assetFileNames": "/_astro/[name]@[width].[hash][extname]" "assetFileNames": "/_astro/[name]@[width].[hash][extname]"
} }

View File

@ -14,7 +14,6 @@ import GalleryK from "@/components/polymech/GalleryK.astro"
## Administration & Sales ## Administration & Sales
[sales@plastic-hub.com](mailto:/sales@plastic-hub.com) [sales@plastic-hub.com](mailto:/sales@plastic-hub.com)
Anne Barbier - +34 691 952 287 Anne Barbier - +34 691 952 287