Content: Missing frontmatter prop is substituted with body
I defined a "pages" collection from this initialization object
I then render a page (
index.en.md
) which does not have a description:
Here's how I load it in the page script
I expect empty description
property but it gets populated with the body instead2 Replies
Hi @tpluscode. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
This behavior is expected in Nuxt Content. When the
See documentation on native parameters. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
description
property is not defined in the frontmatter of a Markdown file, Nuxt Content will automatically use the first paragraph (<p>
) of the body as the description
. This is documented as the default behavior for the description
field:
|So, if you omit thedescription
|string
| First<p>
of the page | Description of the page, will be shown below the title and injected into the metas |
description
in your frontmatter, Nuxt Content will substitute it with the first paragraph of your content body. If you want the description
to be empty, you need to explicitly set it as an empty string in your frontmatter:
This will ensure that the description
property is empty, rather than being auto-filled from the body content.See documentation on native parameters. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
<@555413648382623754> Kapa.ai is still learning and improving, please let me know how I did by reacting below.