Skip to content

Can't modify Markdown frontmatter from remark plugin #3737

Closed
@rgov

Description

@rgov

What version of astro are you using?

2.8.3

Are you using an SSR adapter? If so, which one?

none

What package manager are you using?

nom

What operating system are you using?

macOS Ventura

What browser are you using?

Safari

Describe the Bug

The example given for modifying Markdown frontmatter programmatically doesn't seem to work.

Following exactly that example, I can see (with console.log()) that my plugin is being called. But in one of my .astro files I inspect the data objects for each post, and the inserted field is not present.

(Question: Is there any difference between the markdown and mdx sections of the config file? The documentation seems ambivalent about which to use. I've tried both.)

What's the expected result?

The example should add the customProperty to the front matter.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-klm8sa?file=example-remark-plugin.mjs

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp wantedIssues looking for someone to run with them!improve or update documentationEnhance / update existing documentation (e.g. add example, improve description, update for changes)low effort

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions