diff options
| author | mjfernez <mjfernez@gmail.com> | 2021-10-14 20:14:53 -0400 | 
|---|---|---|
| committer | mjfernez <mjfernez@gmail.com> | 2021-10-14 20:14:53 -0400 | 
| commit | c583a69362f86fcc8e1b35a45a06dd8377d6308f (patch) | |
| tree | 30609b89aa2781c95fc5c04ff96db3ab063e16e7 /templates | |
| parent | f7668243b7a55d1f69d508b3baaf891055715f63 (diff) | |
| download | ezcms-c583a69362f86fcc8e1b35a45a06dd8377d6308f.tar.gz | |
Adds RSS auto-generation for files in 'site'
This commit adds rss_generator.py which contains the main logic for
indexing the site directory and generating a feed on startup. It serves
as a sort of ad-hoc database which is accessed when /feed.xml is
requested.
Also corrects various typos, README nonsense, and expands the config
options for RSS. Instances of './templates/site' have been replaced with
the general BASE_DIR variable in the siteconfig.
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/base.html | 2 | ||||
| -rw-r--r-- | templates/feed.xml | 27 | 
2 files changed, 29 insertions, 0 deletions
| diff --git a/templates/base.html b/templates/base.html index 6476091..5e71e6b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -15,6 +15,8 @@          {% for dir in navbar %}          <b> <a href="/site/{{ dir }}">{{ dir }}/</a> |</b>          {% endfor %} +        <!-- Add icons here --> +        <a href="/feed.xml"><img src="/static/rss.svg"></a>          </div>          <h2>{{ title }}</h2>          <div class="content"> diff --git a/templates/feed.xml b/templates/feed.xml new file mode 100644 index 0000000..a252134 --- /dev/null +++ b/templates/feed.xml @@ -0,0 +1,27 @@ + +<rss version="2.0"> +    <channel> +        <title>{{ config.TITLE }}</title> +        <link>{{ config.LINK }}</link> +        <description>{{ config.DESCRIPTION }}</description> +        <!-- Optional --> +        <language>{{ config.LANGUAGE }}</language> +        <pubDate> {{ config.PUBDATE }}</pubDate> +        <lastBuildDate> {{ config.LASTBUILDDATE }}</lastBuildDate> +        <docs>{{ config.DOCS }}</docs> +        <generator>{{ config.GENERATOR }}</generator> +        <managingEditor>{{ config.AUTHOR }}</managingEditor> +        <webMaster>{{ config.WEBMASTER }}</webMaster> +        {% for item in items %} +        <item> +            <title>{{ item.TITLE }}</title> +            <link>{{ item.LINK }}</link> +            <guid>{{ item.LINK }}</guid> +            <description>{{ item.DESCRIPTION }}</description> +            <pubDate>{{ item.LAST_UPDATE }}</pubDate> +            <category>{{ item.SITE_DIR }}</category> +            <author>{{ config.AUTHOR }}</author> +        </item> +        {% endfor %} +    </channel> +</rss> | 
