Skip to content

Commit

Permalink
fix: feed image
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 16, 2024
1 parent 00a6921 commit a2455d7
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/app/feed/route.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { compiler } from 'markdown-to-jsx'
import RSS from 'rss'
import xss from 'xss'
import type { AggregateRoot } from '@mx-space/api-client'
import type { MarkdownToJSX } from 'markdown-to-jsx'

import { simpleCamelcaseKeys } from '@mx-space/api-client'

import { CDN_HOST } from '~/app.static.config'
import { AlertsRule as __AlertsRule } from '~/components/ui/markdown/parsers/alert'
import { ContainerRule as __ContainerRule } from '~/components/ui/markdown/parsers/container'
Expand All @@ -19,6 +16,8 @@ import { MentionRule } from '~/components/ui/markdown/parsers/mention'
import { SpoilerRule } from '~/components/ui/markdown/parsers/spoiler'
import { apiClient } from '~/lib/request'

import { fetchAggregationData } from '../(app)/api'

export const dynamic = 'force-dynamic'
export const revalidate = 86400 // 1 day

Expand Down Expand Up @@ -46,14 +45,8 @@ export async function GET() {
revalidate: 86400,
},
}).then((res) => res.json() as Promise<RSSProps>),
fetch(apiClient.aggregate.proxy.toString(true), {
next: {
revalidate: 86400,
},
}).then(
async (res) =>
simpleCamelcaseKeys(await res.json()) as Promise<AggregateRoot>,
),

fetchAggregationData(),
])

const { title, description } = agg.seo
Expand All @@ -65,7 +58,7 @@ export async function GET() {
site_url: url,
feed_url: `${url}/feed`,
language: 'zh-CN',
image_url: `${url}/og`,
image_url: `${url}${agg?.theme?.config?.site?.favicon}`,
generator: 'Shiro (https://github.com/Innei/Shiro)',
pubDate: now.toUTCString(),
})
Expand Down

0 comments on commit a2455d7

Please sign in to comment.