Generated Excerpts for Nuxt3 Content
- đź“…
- đź“ť 377 words
- đź•™ 2 minutes
- 📦 Development
- 🏷️ Nuxt, webdev
Nuxt3 has been my stack of choice for a while now and it was time to port my site over from Nuxt2 — an exercise in itself I should blog about — but more concretely is the idea of excerpts.
Basically when you have a list of articles you want to show a short snippet of the article to entice the reader to click on it. This can either be the description if it’s a simple one-liner used in a card for example, or it can be the start of the article itself. Nuxt’s Content v2 supports generating excerpts for you by taking the content up to the <!--more-->
<!--more--> marker in the text as the excerpt.