Compare commits
2 Commits
403f8146d9
...
640097c072
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
640097c072 | ||
|
|
b62865cf04 |
@@ -57,6 +57,6 @@ const settings = await getSettings();
|
|||||||
<meta name="application-name" content={settings.website.applicationName} />
|
<meta name="application-name" content={settings.website.applicationName} />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Astro</h1>
|
<slot />
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,20 +1,10 @@
|
|||||||
---
|
---
|
||||||
import { getSettings } from "@/content/settings/settings"
|
import { getSettings } from "@/content/settings/settings"
|
||||||
|
import WebpageLayout from "@/layouts/WebpageLayout.astro";
|
||||||
|
|
||||||
const settings = await getSettings();
|
const settings = await getSettings();
|
||||||
console.log(settings);
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<html lang="en">
|
<WebpageLayout>
|
||||||
<head>
|
<h1>Test</h1>
|
||||||
<meta charset="utf-8" />
|
</WebpageLayout>
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
||||||
<link rel="icon" href="/favicon.ico" />
|
|
||||||
<meta name="viewport" content="width=device-width" />
|
|
||||||
<meta name="generator" content={Astro.generator} />
|
|
||||||
<title>Astro</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Astro</h1>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
27
astro/src/pages/rss.xml.ts
Normal file
27
astro/src/pages/rss.xml.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import { getSettings } from "@/content/settings/settings";
|
||||||
|
import type { APIRoute } from "astro";
|
||||||
|
import minifyXML from "minify-xml";
|
||||||
|
|
||||||
|
export const GET = (async () => {
|
||||||
|
const settings = await getSettings();
|
||||||
|
|
||||||
|
let sitemapContent = `
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<rss version="2.0">
|
||||||
|
<channel>
|
||||||
|
<title>${settings.website.applicationName}</title>
|
||||||
|
<description>This is the RSS feed of ${settings.website.applicationName}</description>
|
||||||
|
<link>${settings.website.domainName}</link>
|
||||||
|
<lastBuildDate>Sat, 13 Dec 2003 18:30:02 GMT</lastBuildDate>
|
||||||
|
</channel>
|
||||||
|
</rss>
|
||||||
|
`;
|
||||||
|
|
||||||
|
return new Response(minifyXML(sitemapContent), {
|
||||||
|
status: 200,
|
||||||
|
statusText: "OK",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/xml"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}) satisfies APIRoute;
|
||||||
Reference in New Issue
Block a user