mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-27 18:50:29 -04:00
25 lines
599 B
TypeScript
25 lines
599 B
TypeScript
import { getAllNotes } from "../lib/parse-notes";
|
|
import { buildFeed } from "../lib/build-feed";
|
|
import type { GetServerSideProps } from "next";
|
|
|
|
export const getServerSideProps: GetServerSideProps = async (context) => {
|
|
if (context && context.res) {
|
|
const { res } = context;
|
|
|
|
const notes = getAllNotes(["title", "date", "image", "slug", "description"]);
|
|
|
|
const feed = buildFeed(notes);
|
|
res.setHeader("content-type", "application/atom+xml");
|
|
res.write(feed.atom1());
|
|
res.end();
|
|
}
|
|
|
|
return {
|
|
props: {},
|
|
};
|
|
};
|
|
|
|
const AtomPage = () => null;
|
|
|
|
export default AtomPage;
|