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", ".": "./index.ts",
"./api": "./src/api/index.ts", "./api": "./src/api/index.ts",
"./api-core": "./src/api/content-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", "./config": "./src/integrations/virtual-config.ts",
"./types": "./types.ts", "./types": "./types.ts",
"./satoriOG": "./src/integrations/satori.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/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/authors.png.ts": "./src/default-routes/open-graph/authors.png.ts",
"./open-graph/tags.png.ts": "./src/default-routes/open-graph/tags.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"/> <path d="M184 213A140 140 0 0 0 44 73 V 38a175 175 0 0 1 175 175z" fill="#FFF"/>
</svg> </svg>
Web Feed Preview <xsl:value-of select="/rss/channel/title"/> Web Feed
</h1> </h1>
<h2><xsl:value-of select="/rss/channel/title"/></h2>
<p><xsl:value-of select="/rss/channel/description"/></p> <p><xsl:value-of select="/rss/channel/description"/></p>
<a class="head_link" target="_blank"> <a class="head_link" target="_blank">
<xsl:attribute name="href"> <xsl:attribute name="href">
@ -44,7 +43,7 @@
Visit Website &#x2192; Visit Website &#x2192;
</a> </a>
</header> </header>
<h2>Recent Items</h2> <h2>Feed</h2>
<xsl:for-each select="/rss/channel/item"> <xsl:for-each select="/rss/channel/item">
<div class="pb-5"> <div class="pb-5">
<h3 class="mb-0"> <h3 class="mb-0">
@ -59,7 +58,12 @@
<xsl:value-of select="description" /> <xsl:value-of select="description" />
</p> </p>
<small class="text-gray"> <small class="text-gray">
<div>
Author: <xsl:value-of select="author" />
</div>
<div>
Published: <xsl:value-of select="pubDate" /> Published: <xsl:value-of select="pubDate" />
</div>
</small> </small>
</div> </div>
</xsl:for-each> </xsl:for-each>

View File

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