diff --git a/src/feed.rs b/src/feed.rs index 63d8351..d642d44 100644 --- a/src/feed.rs +++ b/src/feed.rs @@ -9,6 +9,7 @@ use crate::{page::Page, tag::Tag, AppState}; struct FeedContext<'a> { feed_url: &'a str, base_url: &'a str, + site_title: &'a str, last_updated: &'a str, tag: Option<&'a Tag>, posts: &'a [&'a Page], @@ -30,6 +31,7 @@ pub fn render_atom_feed(state: &AppState) -> Result { let feed = FeedContext { feed_url: &format!("{}atom.xml", state.base_url), base_url: &state.base_url.to_string(), + site_title: &state.settings.title, last_updated: &updated.map_or_else(String::default, |d| d.to_rfc3339()), tag: None, posts: &posts, @@ -57,6 +59,7 @@ pub fn render_atom_tag_feed(tag: &Tag, state: &AppState) -> Result { let feed = FeedContext { feed_url: &format!("{}tags/{}/atom.xml", state.base_url, slug), base_url: &state.base_url.to_string(), + site_title: &state.settings.title, last_updated: &updated.map_or_else(String::default, |d| d.to_rfc3339()), tag: Some(tag), posts: &posts, diff --git a/templates/atom.xml b/templates/atom.xml index d1fd6ad..242ce09 100644 --- a/templates/atom.xml +++ b/templates/atom.xml @@ -1,16 +1,15 @@ - tollyx.net + <title>{{ site_title }} {%- if tag %} - #{{ tag.slug }}{% endif -%} - tollyx's corner of the web {% if tag -%} {%- else -%} {%- endif %} - tollyx-website + tlxite {{ last_updated | date(format="%+") }} {{ feed_url | safe }} {%- for post in posts %}