Skip to content

Commit

Permalink
feat: add feed metadata
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Mar 12, 2024
1 parent 98331cc commit 1c9aba2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/app/(app)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import { cache } from 'react'
import { ToastContainer } from 'react-toastify'
import type { Viewport } from 'next'
import type { Metadata, Viewport } from 'next'
import type { PropsWithChildren } from 'react'

import { ClerkProvider } from '@clerk/nextjs'
Expand Down Expand Up @@ -58,7 +58,7 @@ const fetchAggregationData = cache(async () => {
revalidate,
)
})
export const generateMetadata = async () => {
export const generateMetadata = async (): Promise<Metadata> => {
const fetchedData = await fetchAggregationData()

const {
Expand Down Expand Up @@ -129,7 +129,14 @@ export const generateMetadata = async () => {
title: seo.title,
description: seo.description,
},
}

alternates: {
canonical: url.webUrl,
types: {
'application/rss+xml': [{ url: 'feed', title: 'RSS 订阅' }],
},
},
} satisfies Metadata
}

export default async function RootLayout(props: PropsWithChildren) {
Expand Down

0 comments on commit 1c9aba2

Please sign in to comment.