diff options
author | Vika <vika@fireburn.ru> | 2025-03-13 11:06:23 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2025-03-13 11:06:23 +0300 |
commit | 4ca3c83d447fbf86a4f21d841a107cb28a64658e (patch) | |
tree | e196c4a83d602bdfeb84f5f5bb1973009e17cf22 /templates/src | |
parent | ab6614c720064a5630100c1ba600942dcab2632f (diff) | |
download | kittybox-4ca3c83d447fbf86a4f21d841a107cb28a64658e.tar.zst |
WIP: RSS feed generator feature/rss
Some people are old-fashioned, and RSS feeds can be consumed even by laypeople unfamiliar with microformats2. This does violate DRY at first glance, but since the feeds are dynamically generated it's not repetition but rather format conversion, and as such does not violate DRY per se.
Diffstat (limited to 'templates/src')
-rw-r--r-- | templates/src/templates.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/templates/src/templates.rs b/templates/src/templates.rs index 9b29fce..986d183 100644 --- a/templates/src/templates.rs +++ b/templates/src/templates.rs @@ -3,7 +3,7 @@ use kittybox_util::micropub::Channel; use crate::{Feed, VCard}; markup::define! { - Template<'a>(title: &'a str, blog_name: &'a str, feeds: Vec<Channel>, user: Option<&'a kittybox_indieauth::ProfileUrl>, content: String) { + Template<'a>(title: &'a str, blog_name: &'a str, feeds: Vec<Channel>, user: Option<&'a kittybox_indieauth::ProfileUrl>, content: String, rss_link: Option<&'a str>) { @markup::doctype() html { head { @@ -22,13 +22,13 @@ markup::define! { // LibreJS-compliant JS licensing info (because TypeScript is a bitch) link[rel="jslicense", href="/.kittybox/static/jslicense.html"]; /*@if let Some(endpoints) = endpoints { - @if let Some(webmention) = &endpoints.webmention { - link[rel="webmention", href=&webmention]; - } @if let Some(microsub) = &endpoints.microsub { link[rel="microsub", href=µsub]; } }*/ + @if let Some(rss) = rss_link { + link[rel="alternate", r#type="application/rss+xml", href=rss]; + } } body { a[href="#main_content", id="skip-to-content"] { "Skip to content" } |