From 4ca3c83d447fbf86a4f21d841a107cb28a64658e Mon Sep 17 00:00:00 2001
From: Vika <vika@fireburn.ru>
Date: Thu, 13 Mar 2025 11:06:23 +0300
Subject: WIP: RSS feed generator

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.
---
 templates/src/templates.rs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'templates/src/templates.rs')

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=&microsub];
                     }
                 }*/
+                @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" }
-- 
cgit 1.4.1