diff --git a/astro.config.ts b/astro.config.ts index 8edfc9a93..933832340 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -3,12 +3,14 @@ import mdx from "@astrojs/mdx"; import tailwind from "@astrojs/tailwind"; import sitemap from "@astrojs/sitemap"; import prefetch from "@astrojs/prefetch"; +import remarkUnwrapImages from "remark-unwrap-images"; // https://astro.build/config export default defineConfig({ // ! Please remember to replace the following site property with your own domain site: "https://astro-theme-cactus.netlify.app/", markdown: { + remarkPlugins: [remarkUnwrapImages], shikiConfig: { theme: "dracula", wrap: true, diff --git a/package.json b/package.json index c20864653..2273c6e35 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "prettier": "^2.8.8", "prettier-plugin-astro": "0.10.0", "prettier-plugin-tailwindcss": "^0.3.0", + "remark-unwrap-images": "^3.0.1", "tailwindcss": "^3.3.2", "typescript": "^5.1.5" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 941e3db8e..8519a89c3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -97,6 +97,9 @@ devDependencies: prettier-plugin-tailwindcss: specifier: ^0.3.0 version: 0.3.0(prettier-plugin-astro@0.10.0)(prettier@2.8.8) + remark-unwrap-images: + specifier: ^3.0.1 + version: 3.0.1 tailwindcss: specifier: ^3.3.2 version: 3.3.2 @@ -4640,6 +4643,15 @@ packages: retext-smartypants: 5.2.0 unist-util-visit: 4.1.2 + /remark-unwrap-images@3.0.1: + resolution: {integrity: sha512-5VUY0n+J9lPTPfkct5S3/SbutryBjp8J/4mbgtlkDrOk3h8jde0hyqdYUJOoJKherZezS08tjd6i4+nnQ+wl5w==} + dependencies: + '@types/mdast': 3.0.11 + hast-util-whitespace: 2.0.1 + unified: 10.1.2 + unist-util-visit: 4.1.2 + dev: true + /resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} diff --git a/src/content/post/markdown-elements/index.md b/src/content/post/markdown-elements/index.md index 4a91bb65a..fba06268a 100644 --- a/src/content/post/markdown-elements/index.md +++ b/src/content/post/markdown-elements/index.md @@ -111,9 +111,11 @@ Right aligned columns ## Images Image in the same folder: `src/content/post/markdown-elements/logo.png` + ![Astro theme cactus logo](./logo.png) Image in the aliased assets folder: `src/assets/about-astro.png` + ![A cartoon cactus looking at the Astro.build logo](~/assets/about-astro.png) ## Links