some code cleanup

This commit is contained in:
Adam Matthiesen 2024-02-05 22:26:24 -08:00
parent 069b097f0b
commit 7d9fe71cb5
3 changed files with 12 additions and 8 deletions

View File

@ -49,12 +49,12 @@
".": "./index.ts",
"./api": "./src/api/index.ts",
"./api-core": "./src/api/content-api/index.ts",
"./404.astro": "./src/default-routes/404/404.astro",
"./rss.xml.ts": "./src/default-routes/rss.xml.ts",
"./rss-style.xsl.ts": "./src/default-routes/rss-style.xsl.ts",
"./config": "./src/integrations/virtual-config.ts",
"./types": "./types.ts",
"./satoriOG": "./src/integrations/satori.ts",
"./404.astro": "./src/default-routes/404/404.astro",
"./rss.xml.ts": "./src/default-routes/rss.xml.ts",
"./rss-style.xsl.ts": "./src/default-routes/rss-style.xsl.ts",
"./open-graph/index.png.ts": "./src/default-routes/open-graph/index.png.ts",
"./open-graph/authors.png.ts": "./src/default-routes/open-graph/authors.png.ts",
"./open-graph/tags.png.ts": "./src/default-routes/open-graph/tags.png.ts",

View File

@ -33,9 +33,8 @@
<path d="M184 213A140 140 0 0 0 44 73 V 38a175 175 0 0 1 175 175z" fill="#FFF"/>
</svg>
Web Feed Preview
<xsl:value-of select="/rss/channel/title"/> Web Feed
</h1>
<h2><xsl:value-of select="/rss/channel/title"/></h2>
<p><xsl:value-of select="/rss/channel/description"/></p>
<a class="head_link" target="_blank">
<xsl:attribute name="href">
@ -44,7 +43,7 @@
Visit Website &#x2192;
</a>
</header>
<h2>Recent Items</h2>
<h2>Feed</h2>
<xsl:for-each select="/rss/channel/item">
<div class="pb-5">
<h3 class="mb-0">
@ -59,7 +58,12 @@
<xsl:value-of select="description" />
</p>
<small class="text-gray">
<div>
Author: <xsl:value-of select="author" />
</div>
<div>
Published: <xsl:value-of select="pubDate" />
</div>
</small>
</div>
</xsl:for-each>

View File

@ -5,12 +5,12 @@ import type { APIContext } from 'astro';
const posts = await getAllPosts();
const settings = await getSettings();
export async function GET({ site, generator }: APIContext) {
export async function GET({ site }: APIContext) {
invariant(settings, "Settings not found");
const title = settings.title;
const description = settings.description;
return rss({
title: `${title} [Built on ${generator.slice(0, 8)}]`,
title: title,
description: description,
site: site?site:"",
stylesheet: "/rss-style.xsl",