Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@altano/remark-astrojs-image
Advanced tools
A remark preset that enhances images in your .mdx files to use @astrojs/image components
⚠️ HIGHLY EXPERIMENTAL: Everything about this package is subject to change, including the name.
This is a remark preset that enhances images in your .mdx files to use @astrojs/image
components. While this preset (and accompanying remark plugins) are not astro specific, if you're not using mdx in an astro site you probably shouldn't be here.
Feature | Before | After |
---|---|---|
Inline import conversion | <Image src="./image.jpg" /> | <Image src={import("./image.jpg")} /> |
img conversion | <img /> | <Image /> |
picture conversion | <picture /> | <Picture /> |
Markdown conversion | ![]("./image.png") | <Image src={import("./image.jpg")} /> |
Preserve attributes | <img width={500} height={500} alt="Alt Text"> | <Image width={500} height={500} alt="Alt Text" /> |
![Alt Text]("./image.png") | <Image alt="Alt Text" src={import("./image.jpg")} /> | |
Component auto import | import {Image} from "@astrojs/image/components"; |
NOTE: This plugin is mdx and esm only. Using components (such as the @astrojs/image
component) from vanilla Markdown (.md
files) has been deprecated in astro. This plugin, and astro's release candidate, require you to use mdx if you want to use components.
Install this remark preset:
# Using NPM
npm install @altano/remark-astrojs-image
# Using Yarn
yarn add @altano/remark-astrojs-image
Edit your astro.config.mjs to add this remark preset:
...
import remarkAstrojsImage from "@altano/remark-astrojs-image";
export default defineConfig({
integrations: [
// You should already have the @astrojs/image integration
image(),
// and the @astrojs/mdx integration
mdx({
remarkPlugins: {
// so just add this preset as a remark plugin:
extends: [remarkAstrojsImage],
},
}),
],
});
FAQs
A remark preset that enhances images in your .mdx files to use @astrojs/image components
We found that @altano/remark-astrojs-image demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.