Skip to content

Excerpts #4246

@MartinMuzatko

Description

@MartinMuzatko

Is your feature request related to a problem? Please describe.

I want to display a preview of the blog post in my blog post list. To also allow HTML, the frontmatter is not suitable for that, since it doesn't allow markdown or html.

Describe the solution you'd like

Common practice in such frameworks is to use a markdown marker such as --- excerpt start --- and --- excerpt end --- to control what is provided within getPageMap (which could have an option for what data to include)
This would also solve not having to duplicate the content in both the frontmatter and as part of the blog post.

Describe alternatives you've considered

Alternatively, I could access the frontmatter to render it within its own blogpost to avoid the duplication.
I could also use <div dangerouslySetInnerHTML={{__html: ''}} /> to render the html in the frontmatter, although that would give me a worse developer experience, since I have to enter HTML in frontmatter - which does not highlight html tags or validate them.

Additional context
Using Nextra 4
Node v22.11.0
npm 10.9.0
Windows 10, WSL - Ubuntu

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions