From 59ecb12a97df8ae7e19a969ef5b21e7802d7483d Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Fri, 16 Apr 2021 17:40:07 -0700 Subject: [PATCH] add back the parts that make an RSS/atom feed... these are based upon slight modifications from the basic template... --- content/atom.xml | 5 +++++ layout/atom.j2 | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ layout/macros.j2 | 40 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 content/atom.xml create mode 100644 layout/atom.j2 diff --git a/content/atom.xml b/content/atom.xml new file mode 100644 index 0000000..bf9dbd7 --- /dev/null +++ b/content/atom.xml @@ -0,0 +1,5 @@ +=== +title: encthenet ramblings +extends: atom.j2 +listable: false +=== diff --git a/layout/atom.j2 b/layout/atom.j2 new file mode 100644 index 0000000..4848312 --- /dev/null +++ b/layout/atom.j2 @@ -0,0 +1,49 @@ +{% from "macros.j2" import render_excerpt, render_post with context %} + + + + {% block title %}{{ resource.meta.title|default(feed_title) }}{% endblock %} + + {% block self_url %} + + {% endblock %} + + {% block site_url %} + + {% endblock %} + + {% block feed_extra %} + {% endblock %} + + {{ time_now|xmldatetime }} + + {{ content_url(resource.url) }}/ + + {% for res in resource.node.walk_resources_sorted_by_time() %} + + {{ res.meta.title|forceescape }} + {{ res.meta.author }} + + {{ res.meta.created|xmldatetime }} + {{ res.meta.created|xmldatetime }} + {{ content_url(res.url) }} + {% for tag in res.meta.tags %} + + {% endfor %} + + + {% refer to res.relative_path as article -%} + {% filter forceescape -%} + {% if resource.meta.excerpts_only -%} + {{ article.image|markdown|typogrify }} + {{ article.excerpt|markdown|typogrify }} + {%- else %} + {{ article.post|markdown|typogrify }} + {%- endif %} + {%- endfilter %} + + + {% endfor %} + diff --git a/layout/macros.j2 b/layout/macros.j2 index e69de29..50f27e0 100644 --- a/layout/macros.j2 +++ b/layout/macros.j2 @@ -0,0 +1,40 @@ +{% macro render_excerpt(res, class=None) %} +{% refer to res.relative_path as post %} +
+ Posted: {{ res.meta.created.strftime('%a, %d %b %Y') }} + +
+{% endmacro %} + +{% macro render_nav(menu, cls=None) -%} +{% if menu -%} + +{%- endif %} +{%- endmacro %} \ No newline at end of file