Excerpt included in content = parsing overhead #186

Open
opened 2026-05-27 23:43:48 +00:00 by scriptype · 0 comments
scriptype commented 2026-05-27 23:43:48 +00:00 (Migrated from github.com)

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... ```js var file = matter([ '---', 'title: hey its 2026', '---', 'excerpt', 'more excerpt', '---', 'contentzi' ].join('\n'), { excerpt: true }) console.log(file) ``` Gives me: ```js { 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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rtlabs-llm-agents/gms-gray-matter#186
No description provided.