question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Content excerpt support

See original GitHub issue

Describe the solution you’d like

Please provide a way to fetch plain content body texts (not the body object of the current fetching result), in order to display excerpt on pages such as content list view. Feature like Content Excerpt of VuePress would be awesome.

Describe alternatives you’ve considered

Having <nuxt-content> prop for displaying excerpt and other selected content properties would be useful too.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
nahokoxxxcommented, Jun 8, 2020

@benjamincanac Sorry for misunderstanding. On the latest commit I succeeded in retrieving only plain excerpt texts using remark plugin properly and retext-stringify plugin additionally.

import remark from 'remark'
import remarkExcerpt from 'remark-excerpt'
import retextStringify from 'retext-stringify'

...
hooks: {
  'content:file:beforeInsert': async (document) => {
    if (document.extension === '.md') {
      const processed = await remark()
        .use(remarkExcerpt)
        .use(retextStringify)
        .process(document.text)
      document.excerpt = processed.contents
    }
  }
}

This workaround should be enough until it is officially supported in a more integrated way. Thank you.

2reactions
benjamincanaccommented, Feb 15, 2021

@imlautaro This has been implemented in the core of @nuxt/content since then: https://content.nuxtjs.org/writing#excerpt.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Add Excerpts to Your Pages in WordPress - WPBeginner
Excerpts are short extracts from your content and help add a description, summary, or small details about the page. By default, excerpts in ......
Read more >
Excerpts – WordPress.com Support
Excerpts are ideal for creating one to two sentence descriptions of the content on a page or post. These excerpts can be used...
Read more >
the_excerpt() | Function - WordPress Developer Resources
Displays the excerpt of the current post after applying several filters to it including auto-p formatting which turns double line-breaks into HTML paragraphs....
Read more >
How to Customize Post Excerpts - Support Center
However, you may not want to use any content from your post as the excerpt. You can create an entirely custom excerpt for...
Read more >
WordPress Excerpt: Use for Posts, Pages & Custom Post Types
Which WordPress post types support excerpts? ... Now you can edit the Excerpt via the meta field which appears below the main content...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found