summaryrefslogtreecommitdiffhomepage
path: root/services/blog/nuldoc-src/pages/AtomPage.tsx
blob: 21c3bfaf014b7141485dcb94d2a43ffe98309997 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { Feed } from "../generators/atom.ts";

export default function AtomPage({ feed }: { feed: Feed }) {
  return (
    <feed xmlns="http://www.w3.org/2005/Atom">
      <id>{feed.id}</id>
      <title>{feed.title}</title>
      <link rel="alternate" href={feed.linkToAlternate} />
      <link rel="self" href={feed.linkToSelf} />
      <author>
        <name>{feed.author}</name>
      </author>
      <updated>{feed.updated}</updated>
      {feed.entries.map((entry) => (
        <entry>
          <id>{entry.id}</id>
          <link rel="alternate" href={entry.linkToAlternate} />
          <title>{entry.title}</title>
          <summary>{entry.summary}</summary>
          <published>{entry.published}</published>
          <updated>{entry.updated}</updated>
        </entry>
      ))}
    </feed>
  );
}