diff --git a/package-lock.json b/package-lock.json index 9ccd321..45f8266 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,9 +7,9 @@ "license": "MIT", "dependencies": { "rehype-class-names": "^2.0.0", - "rehype-figure": "^1.0.1", "rehype-plugin-image-native-lazy-loading": "^1.2.0", "rehype-rewrite": "^4.0.2", + "rehype-title-figure": "^0.1.2", "svelte-icons-pack": "^3.1.3" }, "devDependencies": { @@ -2402,9 +2402,9 @@ "license": "MIT" }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "license": "MIT", "dependencies": { @@ -3004,55 +3004,6 @@ "unified": "^11.0.4" } }, - "node_modules/rehype-figure": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/rehype-figure/-/rehype-figure-1.0.1.tgz", - "integrity": "sha512-g7DJuK8R8xHIaPI3QJ6/OoWiKepn92RF2CV3z4dO7lRO6ZHo48Tu9X3KgnZUKK035srFHqWQx93AybBy12XqmQ==", - "license": "MIT", - "dependencies": { - "hastscript": "^6.0.0", - "unist-util-visit": "^2.0.3" - } - }, - "node_modules/rehype-figure/node_modules/unist-util-is": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz", - "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==", - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/rehype-figure/node_modules/unist-util-visit": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", - "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", - "license": "MIT", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0", - "unist-util-visit-parents": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/rehype-figure/node_modules/unist-util-visit-parents": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", - "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", - "license": "MIT", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/rehype-plugin-image-native-lazy-loading": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/rehype-plugin-image-native-lazy-loading/-/rehype-plugin-image-native-lazy-loading-1.2.0.tgz", @@ -3195,6 +3146,55 @@ "url": "https://jaywcjlove.github.io/#/sponsor" } }, + "node_modules/rehype-title-figure": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/rehype-title-figure/-/rehype-title-figure-0.1.2.tgz", + "integrity": "sha512-CHMIb46yg5/ocVYtLUlvxYSRLCLidijOkSBXRCebTWD6qOuJ3eo/J4gG4zri1Xo4fNH0C8KrA/J4aNdhikzYdQ==", + "license": "MIT", + "dependencies": { + "hastscript": "6.0.0", + "unist-util-visit": "2.0.3" + } + }, + "node_modules/rehype-title-figure/node_modules/unist-util-is": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz", + "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-title-figure/node_modules/unist-util-visit": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", + "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0", + "unist-util-visit-parents": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-title-figure/node_modules/unist-util-visit-parents": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", + "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", @@ -3597,9 +3597,9 @@ } }, "node_modules/svelte": { - "version": "4.2.17", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.17.tgz", - "integrity": "sha512-N7m1YnoXtRf5wya5Gyx3TWuTddI4nAyayyIWFojiWV5IayDYNV5i2mRp/7qNGol4DtxEYxljmrbgp1HM6hUbmQ==", + "version": "4.2.19", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.19.tgz", + "integrity": "sha512-IY1rnGr6izd10B0A8LqsBfmlT5OILVuZ7XsI0vdGPEvuonFV7NYEUK4dAkm9Zg2q0Um92kYjTpS1CAP3Nh/KWw==", "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.1", diff --git a/package.json b/package.json index 9c11428..e1e2950 100644 --- a/package.json +++ b/package.json @@ -25,9 +25,9 @@ }, "dependencies": { "rehype-class-names": "^2.0.0", - "rehype-figure": "^1.0.1", "rehype-plugin-image-native-lazy-loading": "^1.2.0", "rehype-rewrite": "^4.0.2", + "rehype-title-figure": "^0.1.2", "svelte-icons-pack": "^3.1.3" } } diff --git a/svelte.config.js b/svelte.config.js index 6697dd9..52c2204 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -2,19 +2,15 @@ import adapter from "@sveltejs/adapter-static"; import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"; import { mdsvex } from "mdsvex"; import { visit } from "unist-util-visit"; -import figures from "rehype-figure"; +import rehypeTitleFigure from 'rehype-title-figure' import classNames from "rehype-class-names"; -//import lazyLoadPlugin from "rehype-plugin-image-native-lazy-loading"; const classNamesOptions = { h2: "section", h3: "subsection", h4: "subsubsection", a: "link", -}; - -const figuresOptions = { - className: "figure text-center", + figure: "figure" }; const blogImages = () => { @@ -36,10 +32,9 @@ const blogImages = () => { const mdsvexOptions = { extensions: [".md"], rehypePlugins: [ - [figures, figuresOptions], + [rehypeTitleFigure], [classNames, classNamesOptions], blogImages, - //lazyLoadPlugin, ], layout: { blog: "src/lib/blocks/Post.svelte", diff --git a/tailwind.config.js b/tailwind.config.js index 78728ea..c93b382 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -34,12 +34,14 @@ export default { display: "flex", flexDirection: "column", alignItems: "center", - "& img": { - boxShadow: - "rgba(0, 0, 0, 0.04) 0px 0.5em 2em 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px", - borderRadius: "0.6em", - }, }, + img: { + boxShadow: + "rgba(0, 0, 0, 0.04) 0px 0.5em 2em 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px", + borderRadius: "0.6em", + marginLeft: "auto", + marginRight: "auto" + } }, }, md: {