From e3240a57eef6bf0afa193ae83ecd8c5cf627c72f Mon Sep 17 00:00:00 2001 From: Volpeon Date: Wed, 26 May 2021 08:54:19 +0200 Subject: Category list improvements, generate ATOM feeds --- templates/base.html | 4 +++ templates/feed.xml | 50 +++++++++++---------------------- templates/feed_entry.xml | 30 ++++++++++++++++++++ templates/layouts/categorized_list.html | 46 +++++++++++++++--------------- 4 files changed, 74 insertions(+), 56 deletions(-) create mode 100644 templates/feed_entry.xml (limited to 'templates') diff --git a/templates/base.html b/templates/base.html index 5dc57e2..6c0c4a9 100644 --- a/templates/base.html +++ b/templates/base.html @@ -19,6 +19,10 @@ $endif$ + $if(feed)$ + + $endif$ + $if(namespace.root.is_index)$$else$$title$ – $endif$$site.title$ diff --git a/templates/feed.xml b/templates/feed.xml index a968205..ad665d2 100644 --- a/templates/feed.xml +++ b/templates/feed.xml @@ -1,10 +1,10 @@ - $if(section.is_index)$$else$$title$ – $endif$$site.title$ - - - $pages.last_update.rfc3339$ - $url.full$ + $if(namespace.root.is_index)$$else$$title$ – $endif$$site.title$ + + + $last_update.rfc3339$ + $url.abs$ $for(author)$ $it.name$ @@ -14,33 +14,15 @@ $endfor$ - $for(pages.all_dated)$ - - $it.url.full$ - <![CDATA[$it.title$]]> - $if(it.author)$ - $for(it.author)$ - - $it.name$ - $if(it.email)$ - $it.email$ - $endif$ - - $endfor$ - $else$ - $for(author)$ - - $author.name$ - $if(author.email)$ - $author.email$ - $endif$ - - $endfor$ - $endif$ - - $it.date.rfc3339$ - $it.last_update.rfc3339$ - - - $endfor$ + $if(layout.is_categorized_list)$ + $for(pages.all)$ + $for(it.pages.all)$ + $it:feed_entry()$ + $endfor$ + $endfor$ + $else$ + $for(pages.all)$ + $it:feed_entry()$ + $endfor$ + $endif$ diff --git a/templates/feed_entry.xml b/templates/feed_entry.xml new file mode 100644 index 0000000..f4c5d47 --- /dev/null +++ b/templates/feed_entry.xml @@ -0,0 +1,30 @@ + + $it.url.abs$ + $it.title$ + + $if(it.author)$ + $for(it.author)$ + + $it.name$ + $if(it.email)$ + $it.email$ + $endif$ + + $endfor$ + $else$ + $for(author)$ + + $author.name$ + $if(author.email)$ + $author.email$ + $endif$ + + $endfor$ + $endif$ + $if(it.date)$ + $it.date.rfc3339$ + $endif$ + $if(it.last_update)$ + $it.last_update.rfc3339$ + $endif$ + diff --git a/templates/layouts/categorized_list.html b/templates/layouts/categorized_list.html index 8f39229..6e72194 100644 --- a/templates/layouts/categorized_list.html +++ b/templates/layouts/categorized_list.html @@ -8,28 +8,30 @@ $body$
$for(pages.all)$ -

- $it.title$ -

-
- $for(it.pages.all)$ - -
- $it.title$ -
- $if(pages.all.show_dates)$ - - $endif$ -
- $endfor$ -
+ $if(it.pages)$ +

+ $it.title$ +

+
+ $for(it.pages.all)$ + +
+ $it.title$ +
+ $if(pages.all.show_dates)$ + + $endif$ +
+ $endfor$ +
+ $endif$ $endfor$
-- cgit v1.2.3-70-g09d2