feat: add notificarions feed to header

This commit is contained in:
DIYgod
2022-11-04 22:45:05 +00:00
parent 3513d2121c
commit 5ec4c3382d
3 changed files with 11 additions and 5 deletions
+6
View File
@@ -33,6 +33,12 @@ export const SEOHead: React.FC<{
title={title}
type="application/feed+json"
></link>
<link
rel="alternate"
href="/feed"
title={`Notifications on ${title}`}
type="application/feed+json"
></link>
<link rel="icon" href={icon || `${SITE_URL}/logo.svg`}></link>
</Head>
)
+2 -2
View File
@@ -33,9 +33,9 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
version: "https://jsonfeed.org/version/1.1",
title: site.name,
description: site.description,
icon: site.avatars?.[0],
icon: link + site.avatars?.[0],
home_page_url: link,
feed_url: `${link}/feed.json`,
feed_url: `${link}/feed`,
items: pages.list?.map((page: any) => ({
id: page.id,
title: page.title,
@@ -27,11 +27,11 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
ctx.res.write(
JSON.stringify({
version: "https://jsonfeed.org/version/1.1",
title: site.name,
title: "Notifications on " + site.name,
description: site.description,
icon: site.avatars?.[0],
icon: link + site.avatars?.[0],
home_page_url: link,
feed_url: `${link}/feed.json`,
feed_url: `${link}/feed/notifications`,
items: notifications
?.map((notification: any) => {
let key = ""