1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 17:46:39 -04:00

simplify note parsing logic

This commit is contained in:
2022-01-02 23:05:51 -05:00
parent ca614e1a1a
commit 49fb053649
15 changed files with 164 additions and 154 deletions

View File

@ -1,14 +1,12 @@
import { getAllNotes } from "../lib/parse-notes";
import { buildFeed } from "../lib/build-feed";
import type { GetServerSideProps } from "next";
const AtomPage = () => null;
export const getServerSideProps: GetServerSideProps = async (context) => {
const notes = getAllNotes(["title", "date", "image", "slug", "description"]);
const feed = buildFeed(notes);
const feed = buildFeed();
const { res } = context;
res.setHeader("content-type", "application/atom+xml");
res.write(feed.atom1());
res.end();