diff --git a/package-lock.json b/package-lock.json index 2c9a717..d9f3738 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,6 +31,7 @@ "eslint-plugin-svelte": "^2.36.0", "globals": "^15.0.0", "mdsvex": "^0.12.3", + "mdsvex-relative-images": "^1.0.3", "prettier": "^3.1.1", "prettier-plugin-svelte": "^3.1.2", "prettier-plugin-tailwindcss": "^0.6.5", @@ -2868,6 +2869,13 @@ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, + "node_modules/just-camel-case": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/just-camel-case/-/just-camel-case-4.0.2.tgz", + "integrity": "sha512-df6QI/EIq+6uHe/wtaa9Qq7/pp4wr4pJC/r1+7XhVL6m5j03G6h9u9/rIZr8rDASX7CxwDPQnZjffCo2e6PRLw==", + "dev": true, + "license": "MIT" + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -3040,6 +3048,62 @@ "svelte": "^3.56.0 || ^4.0.0 || ^5.0.0-next.120" } }, + "node_modules/mdsvex-relative-images": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/mdsvex-relative-images/-/mdsvex-relative-images-1.0.3.tgz", + "integrity": "sha512-3XvpnaguRAhC5gchpqCH+A5Yl28xG9WDPylVla0+k90c5LT+QqSM+hwHd1v5C7gB2cAT0AIhuMsY/g6aCw+WDg==", + "dev": true, + "license": "ISC", + "dependencies": { + "just-camel-case": "^4.0.2", + "unist-util-visit": "^3.1.0" + } + }, + "node_modules/mdsvex-relative-images/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdsvex-relative-images/node_modules/unist-util-visit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-3.1.0.tgz", + "integrity": "sha512-Szoh+R/Ll68QWAyQyZZpQzZQm2UPbxibDvaY8Xc9SUtYgPsDzx5AWSk++UUt2hJuow8mvwR+rG+LQLw+KsuAKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdsvex-relative-images/node_modules/unist-util-visit-parents": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-4.1.1.tgz", + "integrity": "sha512-1xAFJXAKpnnJl8G7K5KgU7FY55y3GcLIXqkzUj5QF/QVP7biUm0K0O2oqVkYsdjzJKifYeWn9+o6piAK2hGSHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", diff --git a/package.json b/package.json index c99aa5c..ae4d380 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "eslint-plugin-svelte": "^2.36.0", "globals": "^15.0.0", "mdsvex": "^0.12.3", + "mdsvex-relative-images": "^1.0.3", "prettier": "^3.1.1", "prettier-plugin-svelte": "^3.1.2", "prettier-plugin-tailwindcss": "^0.6.5", diff --git a/svelte.config.js b/svelte.config.js index d7742f0..205a319 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -3,6 +3,7 @@ import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; import { mdsvex } from 'mdsvex'; import remarkAlert from './src/lib/markdown.js' +import relativeImages from 'mdsvex-relative-images' import remarkToc from 'remark-toc' import rehypeSlug from 'rehype-slug' @@ -17,6 +18,7 @@ const config = { extensions: ['.md'], remarkPlugins: [ remarkAlert, + relativeImages, [remarkToc, {tight: true}], ], rehypePlugins: [