1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 18:06:38 -04:00

v5: Revenge of the JavaScript 🦸 (#711)

Hugo ➡️ Next.js
This commit is contained in:
2021-12-30 08:18:41 -05:00
committed by GitHub
parent b7505fa260
commit 9979e1bf3f
577 changed files with 8019 additions and 11864 deletions

24
pages/feed.atom.ts Normal file
View File

@ -0,0 +1,24 @@
import { getAllNotes } from "../lib/parseNotes";
import { buildFeed } from "../lib/buildFeed";
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;