-
-
Notifications
You must be signed in to change notification settings - Fork 187
Feature: Implement Excerpt Field in Blog Post Format #846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Implement Excerpt Field in Blog Post Format #846
Conversation
TimidRobot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update to support markdown excerpts
models/blog-post.ini
Outdated
|
|
||
| [fields.excerpt] | ||
| label = Excerpt | ||
| type = text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please:
- make this
markdowninstead oftext - restore the newline at end of file
| {{ render_authors_byline(post) }} | ||
| <div class="excerpt"> | ||
| {{ post.body | excerpt | string | striptags() | truncate(100) }} | ||
| {{ post.excerpt | default(post.body) | striptags | truncate(100) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update to support markdown excerpts. Something like:
{% if post.excerpt %}
{{ post.excerpt }}
{% else %}
{{ post.body | excerpt | string | striptags() | truncate(100) }}
{% endif %}
|
@SumaiyaaRq thank you for your work on this!! Closing this pull request in favor of the earlier: |
Fixes
Description
This PR enhances the blog post feature by adding the ability for authors to include custom excerpts for each blog post. It allows for better control over the preview content that readers will see, providing an engaging summary for the post. If no custom excerpt is provided, the first 100 words of the blog post body will be used by default . This improves content presentation and increases the chances of engaging readers right from the preview.
Technical Details
excerptfield tocontents.lrfor authors to input custom excerptsfor blog posts.
post.htmlto handle and display the excerpt field and provided a defaultmechanism to use first 100 words if the excerpt is not provided.
blog-post.inito include excerpt field.Tests
Screenshots
Sample Blog for Testing the Excerpt Field :

Excerpt Field preview:

Checklist
Update index.md).mainormaster).visible errors.
Developer Certificate of Origin
For the purposes of this DCO, "license" is equivalent to "license or public domain dedication," and "open source license" is equivalent to "open content license or public domain dedication."
Developer Certificate of Origin