diff options
author | Michal Sapka <michal@sapka.me> | 2022-09-05 22:40:17 +0200 |
---|---|---|
committer | Michal Sapka <michal@sapka.me> | 2022-09-05 22:58:48 +0200 |
commit | 9c1cd928f15624b7a03fdbbc4a3c434568a07e48 (patch) | |
tree | ad11fa6b824ab42b396976a5f25bcfcf36abc2bb /pages | |
parent | 065ebd57cd9da8e9e6c74152f7ab1200d6a6d013 (diff) |
feat: add RSS feed
Diffstat (limited to 'pages')
-rw-r--r-- | pages/_document.tsx | 4 | ||||
-rw-r--r-- | pages/index.tsx | 11 |
2 files changed, 11 insertions, 4 deletions
diff --git a/pages/_document.tsx b/pages/_document.tsx index ef9fcd3b..ca81402c 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -6,6 +6,10 @@ export default function Document() { return ( <Html lang="en"> <Head /> + <title>MichaĆ Sapka's website</title> + <link rel="alternate" type="application/rss+xml" href="https://michal.sapka.me/rss/feed.xml" title="Recent publications RSS Feed" /> + <link rel="alternate" type="application/feed+json" href="https://michal.sapka.me/rss/feed.json" title="Recent publications RSS Feed" /> + <link rel="alternate" type="application/atom+xml" href="https://michal.sapka.me/rss/atom.xml" title="Recent publications RSS Feed" /> <body> <ColorModeScript initialColorMode={theme.config.initialColorMode} /> <Main /> diff --git a/pages/index.tsx b/pages/index.tsx index 4477d0b0..2e733685 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,8 +1,5 @@ import type { NextPage } from 'next' -import Head from 'next/head' -import Image from 'next/image' import Layout from '../components/layout' -import styles from '../styles/Home.module.css' import { VStack, HStack, @@ -17,6 +14,7 @@ import { } from '@chakra-ui/react' import { AiFillGithub,AiFillMediumCircle} from "react-icons/ai"; import Publications from "../data/publications" +import generateRssFeed from "../lib/feed" type BioEntryType = { date: string, @@ -71,7 +69,7 @@ const Home: NextPage = () => { <VStack spacing="1" alignItems="start"> {Publications.map((value, key) => { return <Box key={key}> - <Link href={value.url} isExternal>{value.name}</Link> + <Link href={value.url} isExternal>{value.title}</Link> </Box> })} @@ -103,4 +101,9 @@ const Home: NextPage = () => { ) } +export const getStaticProps = async (context : any) => { + await generateRssFeed(); + return { props: {} }; +}; + export default Home |