From a113ba2271a9c1285f194c08e3e61e3badb57df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar?= Date: Sun, 17 Sep 2023 14:12:12 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(atom):=20add=20`full=5Fcontent?= =?UTF-8?q?=5Fin=5Ffeed`=20option=20(#164)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.toml | 4 ++++ templates/atom.xml | 4 +++- theme.toml | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/config.toml b/config.toml index 02f52c9..a5e851e 100644 --- a/config.toml +++ b/config.toml @@ -147,6 +147,10 @@ menu = [ # The RSS icon will be shown if (1) it's enabled and (2) the following variable is set to true. feed_icon = true +# Show the full post content in the Atom feed. +# If it's set to false, only the description or summary will be shown. +full_content_in_feed = false + # Email address for footer's social section. # Protect against spambots: # 1. Use base64 for email (convert at https://www.base64encode.org/ or `printf 'your@email.com' | base64`). diff --git a/templates/atom.xml b/templates/atom.xml index d57127f..09115c0 100644 --- a/templates/atom.xml +++ b/templates/atom.xml @@ -61,7 +61,9 @@ {{ page.permalink | safe }} - {% if page.summary -%} + {% if config.extra.full_content_in_feed %} + {{ page.content | safe }} + {% elif page.summary -%} {{ page.summary | striptags | safe | trim_end_matches(pat=".") }}… {% elif page.description -%} {{ page.description | striptags | safe }} diff --git a/theme.toml b/theme.toml index 793cdd8..df283a3 100644 --- a/theme.toml +++ b/theme.toml @@ -130,6 +130,10 @@ menu = [ # The RSS icon will be shown if (1) it's enabled and (2) the following variable is set to true. feed_icon = true +# Show the full post content in the Atom feed. +# If it's set to false, only the description or summary will be shown. +full_content_in_feed = false + # Email address for footer's social section. # Protect against spambots: # 1. Use base64 for email (convert at https://www.base64encode.org/ or `printf 'your@email.com' | base64`).