fix(summary): update default parameters

Default to:
auto_generate_post_summary = true
auto_generated_summary_length = 200

Addresses https://github.com/welpo/tabi/pull/579
Closes https://github.com/welpo/tabi/issues/491
This commit is contained in:
Lee Kai Ze 2025-11-13 15:12:59 +08:00
parent 752aacb84c
commit 1ff91cebcf
3 changed files with 7 additions and 7 deletions

View file

@ -169,12 +169,11 @@ show_date = true
# "both" - Show both the original date and the last updated date.
post_listing_date = "date"
# Auto generate summary for post listing and Atom feeds.
# Auto generate summary for post listing and Atom feeds,
# when no summary is set using the <!-- more --> tag.
# It will be generated in separated paragraph alongside with post description.
# Auto generated when no summary is set using the <!-- more --> tag.
auto_generated_summary_length = 300
auto_generated_post_listing_summary = true
auto_generated_atom_feed_summary = true
auto_generate_post_summary = true
auto_generated_summary_length = 200
# Enable iine like buttons on all posts: https://iine.to/
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy

View file

@ -101,13 +101,14 @@
<content type="html">{{ page.content }}</content>
{% endif -%}
<summary type="xhtml">
<!-- xhtml allows multi-paragraph summary -->
<div xmlns="http://www.w3.org/1999/xhtml">
{% if page.description -%}
<p>{{ page.description | markdown(inline=true) | safe }}</p>
{% endif %}
{% if page.summary -%}
<p>{{ page.summary | striptags | trim_end_matches(pat=".") | safe }}...</p>
{% elif config.extra.auto_generated_atom_feed_summary %}
{% elif config.extra.auto_generate_post_summary %}
<p>{{ page.content | striptags | truncate(length=config.extra.auto_generated_summary_length) | safe }}</p>
{% endif %}
</div>

View file

@ -146,7 +146,7 @@
{% endif %}
{% if post.summary %}
<p>{{ post.summary | striptags | trim_end_matches(pat=".") | safe }}...</p>
{% elif config.extra.auto_generated_post_listing_summary %}
{% elif config.extra.auto_generate_post_summary %}
<p>{{ post.content | striptags | truncate(length=config.extra.auto_generated_summary_length) | safe }}</p>
{% endif %}
</div>