Customize Post Excerpt
The excerpt is a short description of a post used in:
- Post cards
- Post headers
- RSS feeds
- Search results
Setting a Custom Excerpt
To set a custom excerpt:
- Add an
excerpt
field to the post’s frontmatter - Provide your desired excerpt text
Example:
===
excerpt: My awesome post
===
Why Use Custom Excerpts?
- Improve SEO: Craft targeted descriptions for search engines
- Enhance Readability: Provide clear, concise summaries for readers
- Control Content Display: Ensure the most relevant information appears in previews
FAQ
Q: What if I don’t set a custom excerpt?
A: The system will automatically generate an excerpt from the beginning of your post content.
Q: Is there a character limit for excerpts?
A: While there’s no strict limit, aim for 150-160 characters for optimal display in search results.
Deep Dive: Excerpt Generation
How automatic excerpt generation works
When a custom excerpt isn’t provided, the system:
- Takes the first sentence of your post
- Removes any HTML tags
- Truncates the text to a reasonable length
- Adds an ellipsis (…) if the content was truncated
This process ensures a consistent appearance across your site, even for posts without manual excerpts.