diff --git a/config.toml b/config.toml index 18a5d45..3c9f105 100644 --- a/config.toml +++ b/config.toml @@ -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 tag. # It will be generated in separated paragraph alongside with post description. -# Auto generated when no summary is set using the 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 diff --git a/templates/atom.xml b/templates/atom.xml index f19c3bf..0a9e8c4 100644 --- a/templates/atom.xml +++ b/templates/atom.xml @@ -101,13 +101,14 @@ {{ page.content }} {% endif -%} +
{% if page.description -%}

{{ page.description | markdown(inline=true) | safe }}

{% endif %} {% if page.summary -%}

{{ page.summary | striptags | trim_end_matches(pat=".") | safe }}...

- {% elif config.extra.auto_generated_atom_feed_summary %} + {% elif config.extra.auto_generate_post_summary %}

{{ page.content | striptags | truncate(length=config.extra.auto_generated_summary_length) | safe }}

{% endif %}
diff --git a/templates/macros/list_posts.html b/templates/macros/list_posts.html index 2a03a85..03b50e5 100644 --- a/templates/macros/list_posts.html +++ b/templates/macros/list_posts.html @@ -146,7 +146,7 @@ {% endif %} {% if post.summary %}

{{ post.summary | striptags | trim_end_matches(pat=".") | safe }}...

- {% elif config.extra.auto_generated_post_listing_summary %} + {% elif config.extra.auto_generate_post_summary %}

{{ post.content | striptags | truncate(length=config.extra.auto_generated_summary_length) | safe }}

{% endif %}