Hi, I stumbled across this project while looking for a front matter package that fully respects YAML specs. Such a well-crafted project!
My issue...
var file = matter([
'---',
'title: hey its 2026',
'---',
'excerpt',
'more excerpt',
'---',
'contentzi'
].join('\n'), { excerpt: true })
console.log(file)
Gives me:
{
content: 'excerpt\nmore excerpt\n---\ncontentzi',
data: { title: 'hey its 2026' },
isEmpty: false,
excerpt: 'excerpt\nmore excerpt\n'
}
And this means, I need to parse the content field one more time to get rid of the excerpt part. It's useless since I already get the excerpt in its own field. My use-case: building a static CMS.
I guess the assumption was that the excerpt will be the natural beginning of content.
However, an excerpt, by definition, is a paraphrasing of or a quote from any part of the content, and is not necessarily just the first few sentences of the content. So, it was a surprise to see excerpt embedded in content.
If most people use the first few lines in the content as excerpt, they still need to parse the content field anyway, at least to remove '---\n' before sending it to a markdown parser as the full text body.
So, my wish: don't include excerpt in content. People who were relying on excerpt being in content would replace their remove-excerpt-dashes-from-content logic with a content-prefixing-with-excerpt logic. And in my case, no extra work would be needed.
Hi, I stumbled across this project while looking for a front matter package that fully respects YAML specs. Such a well-crafted project!
My issue...
Gives me:
And this means, I need to parse the
contentfield one more time to get rid of the excerpt part. It's useless since I already get the excerpt in its own field. My use-case: building a static CMS.I guess the assumption was that the excerpt will be the natural beginning of content.
However, an excerpt, by definition, is a paraphrasing of or a quote from any part of the content, and is not necessarily just the first few sentences of the content. So, it was a surprise to see excerpt embedded in content.
If most people use the first few lines in the content as excerpt, they still need to parse the content field anyway, at least to remove '---\n' before sending it to a markdown parser as the full text body.
So, my wish: don't include excerpt in content. People who were relying on excerpt being in content would replace their
remove-excerpt-dashes-from-contentlogic with acontent-prefixing-with-excerptlogic. And in my case, no extra work would be needed.