diff --git a/CHANGELOG.md b/CHANGELOG.md index 20885a05..1e66120c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Config value `rss_limit` is renamed to `feed_limit` - Config value `languages.*.rss` is renamed to `languages.*.feed` - Config value `generate_rss` is renamed to `generate_feed` + - Feed template variable `last_build_date` is renamed to `latest_date` Users with existing feeds should either set `feed_filename = "rss.xml"` in config.toml to keep things the same, or set up a 3xx redirect from rss.xml to atom.xml so that existing feed consumers aren’t broken. diff --git a/components/site/src/lib.rs b/components/site/src/lib.rs index 0ef6615b..88c8c0a9 100644 --- a/components/site/src/lib.rs +++ b/components/site/src/lib.rs @@ -1065,7 +1065,7 @@ impl Site { pages.par_sort_unstable_by(sort_actual_pages_by_date); - context.insert("last_build_date", &pages[0].meta.date.clone()); + context.insert("latest_date", &pages[0].meta.date.clone()); let library = self.library.read().unwrap(); // limit to the last n elements if the limit is set; otherwise use all. let num_entries = self.config.feed_limit.unwrap_or_else(|| pages.len()); diff --git a/components/templates/src/builtins/atom.xml b/components/templates/src/builtins/atom.xml index 17f5fe41..dcbe7507 100644 --- a/components/templates/src/builtins/atom.xml +++ b/components/templates/src/builtins/atom.xml @@ -5,7 +5,7 @@ Zola - {{ last_build_date | date(format="%+") }} + {{ latest_date | date(format="%+") }} {{ feed_url | safe }} {%- for page in pages %} Zola {{ config.default_language }} - {{ last_build_date | date(format="%a, %d %b %Y %H:%M:%S %z") }} + {{ latest_date | date(format="%a, %d %b %Y %H:%M:%S %z") }} {%- for page in pages %} {{ page.title }} diff --git a/docs/content/documentation/templates/feeds.md b/docs/content/documentation/templates/feeds.md index b013b514..71fd7c1d 100644 --- a/docs/content/documentation/templates/feeds.md +++ b/docs/content/documentation/templates/feeds.md @@ -20,6 +20,6 @@ need to provide a template yourself. The feed template gets three variables in addition to `config`: - `feed_url`: the full url to that specific feed -- `last_build_date`: the date of the latest post +- `latest_date`: the date of the latest post - `pages`: see [page variables](@/documentation/templates/pages-sections.md#page-variables) for a detailed description of what this contains