Open this example in the interactive library
Source code
// components/RSSAndReaderLinks.tsx
import Link from "next/link";
export default function RSSAndReaderLinks({
items = [
{ slug: "getting-started", title: "Getting started" },
{ slug: "building", title: "Building" },
],
}: { items?: { slug: string; title: string }[] } = {}) {
return (
<ul>
{items.map((i) => (
<li key={i.slug}>
<Link href={"/feeds/" + encodeURIComponent(i.slug)}>{i.title}</Link>{" "}
<a href={"/feeds/" + encodeURIComponent(i.slug) + "/rss.xml"}>RSS</a>
</li>
))}
</ul>
);
}
