diff --git a/templates/atom.xml b/templates/atom.xml new file mode 100644 index 0000000..110c4c4 --- /dev/null +++ b/templates/atom.xml @@ -0,0 +1,43 @@ + + + {{ 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 is_local = "127.0.0.1" in config.base_url or "localhost" in config.base_url %} + {%- set current_ts = now(timestamp=true) %} + {%- for page in pages %} + {%- set page_ts = page.date | date(format="%s") | int %} + {%- if is_local or page_ts <= current_ts %} + + {{ page.title }} + {{ page.date | date(format="%+") }} + {{ page.updated | default(value=page.date) | date(format="%+") }} + + + {%- if page.authors %} + {{ page.authors | first }} + {%- elif config.author %} + {{ config.author }} + {%- else %} + Unknown + {%- endif %} + + + + {{ page.permalink | safe }} + {% if page.summary %} + {{ page.summary }} + {% endif %} + {{ page.content }} + + {%- endif %} + {%- endfor %} + diff --git a/templates/rss.xml b/templates/rss.xml new file mode 100644 index 0000000..ead20af --- /dev/null +++ b/templates/rss.xml @@ -0,0 +1,36 @@ + + + + {{ config.title }} + {%- if term %} - {{ term.name }} + {%- elif section.title %} - {{ section.title }} + {%- endif -%} + + {% if config.description %}{{ config.description }}{% endif %} + {{ config.base_url | safe }} + + Zola + {{ last_updated | date(format="%a, %d %b %Y %H:%M:%S %z") }} + {%- set is_local = "127.0.0.1" in config.base_url or "localhost" in config.base_url %} + {%- set current_ts = now(timestamp=true) %} + {%- for page in pages %} + {%- set page_ts = page.date | date(format="%s") | int %} + {%- if is_local or page_ts <= current_ts %} + + {{ page.title }} + {{ page.date | date(format="%a, %d %b %Y %H:%M:%S %z") }} + + {%- if page.authors %}{{ page.authors | first }} + {%- elif config.author %}{{ config.author }} + {%- else %}Unknown + {%- endif -%} + + {{ page.permalink | safe }} + {{ page.permalink | safe }} + {% if page.summary %}{{ page.summary }} + {% else %}{{ page.content }}{% endif %} + + {%- endif %} + {%- endfor %} + +