From 5b13ff21992a61eb8b03670ae1742a72703c2afe Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Thu, 06 Mar 2025 02:16:24 +0000
Subject: [PATCH] feat: support emitters defining external resources, emit link from contentindex directly

---
 quartz/plugins/emitters/contentIndex.tsx |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/quartz/plugins/emitters/contentIndex.ts b/quartz/plugins/emitters/contentIndex.tsx
similarity index 93%
rename from quartz/plugins/emitters/contentIndex.ts
rename to quartz/plugins/emitters/contentIndex.tsx
index 5d76e08..bd609b4 100644
--- a/quartz/plugins/emitters/contentIndex.ts
+++ b/quartz/plugins/emitters/contentIndex.tsx
@@ -182,6 +182,20 @@
 
       return emitted
     },
+    externalResources: (ctx) => {
+      if (opts?.enableRSS) {
+        return {
+          additionalHead: [
+            <link
+              rel="alternate"
+              type="application/rss+xml"
+              title="RSS Feed"
+              href={`https://${ctx.cfg.configuration.baseUrl}/index.xml`}
+            />,
+          ],
+        }
+      }
+    },
     getQuartzComponents: () => [],
   }
 }

--
Gitblit v1.10.0