diff --git a/config.toml b/config.toml index 108973f9f..25d890aa1 100644 --- a/config.toml +++ b/config.toml @@ -13,7 +13,7 @@ build_search_index = false default_language = "en" generate_feeds = true -feed_filenames = ["atom.xml", "rss.xml"] +feed_filenames = ["atom.xml", "rss.xml","no-twim-rss.xml", "no-twim-atom.xml"] taxonomies = [ { name = "author", feed = false, paginate_by = 10 }, diff --git a/templates/no-twim-atom.xml b/templates/no-twim-atom.xml new file mode 100644 index 000000000..002dbca55 --- /dev/null +++ b/templates/no-twim-atom.xml @@ -0,0 +1,41 @@ +{% import "macros/atom.html" as atom %} + + + {{ config.title }} + {%- if term %} - {{ term.name }} + {%- elif section.title %} - {{ section.title }} + {%- endif -%} + + {%- if config.description %} + {{ config.description }} + {%- endif %} + + + Zola + {{ last_updated | date(format="%+") }} + {{ feed_url | safe }} + {% set filtered_pages = [] %} + {% for page in pages %} + {% set path_lower = page.path | lower %} + {% set is_twim = path_lower is containing("twim") or path_lower is containing("this-week-in-matrix") %} + {% if not is_twim %} + {% set_global filtered_pages = filtered_pages | concat(with=page) %} + {% endif %} + {% endfor %} + {% set pageslen = filtered_pages | length %} + {% if pageslen > 15 %} + {% for i in range(end=15) %} + {{ atom::entry(page=filtered_pages[i]) }} + {% endfor %} + {% else %} + {%- for page in filtered_pages %} + {{ atom::entry(page=page) }} + {%- endfor %} + {% endif %} + \ No newline at end of file diff --git a/templates/no-twim-rss.xml b/templates/no-twim-rss.xml new file mode 100644 index 000000000..c080e187c --- /dev/null +++ b/templates/no-twim-rss.xml @@ -0,0 +1,46 @@ + + + + {{ config.title }} + {%- if term %} - {{ term.name }} + {%- elif section.title %} - {{ section.title }} + {%- endif -%} + + + {%- if section -%} + {{ section.permalink | escape_xml | safe }} + {%- else -%} + {{ config.base_url | escape_xml | safe }} + {%- endif -%} + + {{ config.description }} + Zola + {{ lang }} + + {{ last_updated | date(format="%a, %d %b %Y %H:%M:%S %z") }} + {% for page in pages %} + {% set path_lower = page.path | lower %} + {% set is_twim = path_lower is containing("twim") or path_lower is containing("this-week-in-matrix") %} + {% if not is_twim %} + + {{ page.title }} + {{ page.date | date(format="%a, %d %b %Y %H:%M:%S %z") }} + + {%- if page.taxonomies.author -%} + {%- for author in page.taxonomies.author -%} + {{ author | default(value=["unknown author"]) }}{%- if not loop.last -%}, {% endif -%} + {%- endfor -%} + {%- elif config.author -%} + {{ config.author }} + {%- else -%} + Unknown + {%- endif -%} + + {{ page.permalink | escape_xml | safe }} + {{ page.permalink | escape_xml | safe }} + {{ page.content }} + + {% endif %} + {%- endfor %} + +