This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@astro-m2dx/remark-astro-raw-mdx
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

Astro M²DX - Remark plugin to inject raw MDX into frontmatter

DEPRECATED: Please consider using the plugin astro-m2dx, which bundles all features from the different @astro-m2dx plugins in one plugin (all features are opt-in).

remark plugin to add the raw markdown content to the frontmatter of your Astro MDX files.

Astro M²DX is a set of plugins allowing you to define an Astro 🚀 publishing pipeline for Markdown/MDX documents with full MDX features, but without the technical fuss, i.e. you and your non-tech editors can write clean markdown.

Have a look at the other astro-m2dx plugins.

Content

What is this?

This package is a remark plugin to add the raw markdown content to the frontmatter of your MDX files in the context of Astro site generation.

Astro MDX files do not carry the raw MDX content anymore, once you import them. With this plugin you can access the raw content in the frontmatter mdx property.

When should I use this?

If you want to have access to the raw MDX content while generating your Astro pages.

Install

This package is ESM only. In Node.js (version 12.20+, 14.14+, or 16.0+), install with npm:

npm install -D @astro-m2dx/remark-astro-raw-mdx

Use

In your astro.config.mjs

import { defineConfig } from 'astro/config';

import mdx from '@astrojs/mdx';
import rawMdx from '@astro-m2dx/remark-astro-raw-mdx';
// ^^^

// https://astro.build/config
export default defineConfig({
  integrations: [mdx()],
  markdown: {
    remarkPlugins: [rawMdx],
    //              ^^^
    extendDefaultPlugins: true,
  },
});

This uses the default options, where the name of the property on the frontmatter is mdx.

Options

If you want to use a different name for the property, you can specify it in the plugin's name option like so:

    remarkPlugins: [[rawMdx, {property: "raw"}]],

Package Sidebar

Install

npm i @astro-m2dx/remark-astro-raw-mdx

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

5.29 kB

Total Files

6

Last publish

Collaborators

  • shackhacker-christian