Skip to content

Original Markdown from content files should be accessible (as it was in Nuxt Content v1) #2105

@NJKode

Description

@NJKode

Problem Description

I am migrating a site to Nuxt v3 and Nuxt Content v2. Previously, I could access the markdown for a given page by passing the text: true option to the $content() function.

However, that markdown is simply no longer accessible. The migration guide here specifies:

queryContent provides same utilities as legacy $content

Which is evidently not the case.

Desired Behaviour

Both useContent() and queryContent() should return text (or equivalent) along with the rest of the data. I don't see why this shouldn't be the case. If I want to filter this out (i.e. fetch the page data without the markdown), I can just use without() or only() as part of my query.

Alternatives considered

I have considered processing the returned body object to extract the text. However, this seems overly complicated - especially as I was able to just obtain the text in v1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions