diff --git a/docs/app/blog/_components/blog-list.tsx b/docs/app/blog/_components/blog-list.tsx index 83abfd0a93..1b1ef48aa3 100644 --- a/docs/app/blog/_components/blog-list.tsx +++ b/docs/app/blog/_components/blog-list.tsx @@ -1,4 +1,5 @@ import { DiscordLogoIcon } from "@radix-ui/react-icons"; +import { RssIcon } from "lucide-react"; import Image from "next/image"; import Link from "next/link"; import { formatBlogDate } from "@/lib/blog"; @@ -7,7 +8,6 @@ import { IconLink } from "./changelog-layout"; import { Glow } from "./default-changelog"; import { BookIcon, GitHubIcon, XIcon } from "./icons"; import { StarField } from "./stat-field"; -import { RssIcon } from "lucide-react"; export async function BlogPage() { const posts = blogs.getPages().sort((a, b) => { diff --git a/docs/app/blog/rss.xml/route.ts b/docs/app/blog/rss.xml/route.ts index f724173836..2c7245cdf9 100644 --- a/docs/app/blog/rss.xml/route.ts +++ b/docs/app/blog/rss.xml/route.ts @@ -3,9 +3,9 @@ import { getRSS } from "@/lib/rss"; export const revalidate = false; export function GET() { - return new Response(getRSS(), { - headers: { - "Content-Type": "application/rss+xml; charset=utf-8" - } - }); + return new Response(getRSS(), { + headers: { + "Content-Type": "application/rss+xml; charset=utf-8", + }, + }); } diff --git a/docs/lib/metadata.ts b/docs/lib/metadata.ts index 425c051232..771bb6ccc6 100644 --- a/docs/lib/metadata.ts +++ b/docs/lib/metadata.ts @@ -20,16 +20,16 @@ export function createMetadata(override: Metadata): Metadata { ...override.twitter, }, alternates: { - types: { + types: { "application/rss+xml": [ - { + { title: "Better Auth Blog", - url: "https://better-auth.com/blog/rss.xml" - } + url: "https://better-auth.com/blog/rss.xml", + }, ], }, ...override.alternates, - } + }, }; } diff --git a/docs/lib/rss.ts b/docs/lib/rss.ts index a62afa79e8..b757f48ae1 100644 --- a/docs/lib/rss.ts +++ b/docs/lib/rss.ts @@ -3,35 +3,41 @@ import { blogs } from "./source"; import { baseUrl } from "./utils"; export function getRSS() { - const feed = new Feed({ - title: "Better Auth Blog", - description: "Latest updates, articles, and insights about Better Auth", - generator: "better-auth", - id: `${baseUrl}blog`, - link: `${baseUrl}blog`, - language: "en", - image: `${baseUrl}release-og/blogs.png`, - favicon: `${baseUrl}favicon/favicon-32x32.png`, - copyright: `All rights reserved ${new Date().getFullYear()}, Better Auth Inc.`, - }); + const feed = new Feed({ + title: "Better Auth Blog", + description: "Latest updates, articles, and insights about Better Auth", + generator: "better-auth", + id: `${baseUrl}blog`, + link: `${baseUrl}blog`, + language: "en", + image: `${baseUrl}release-og/blogs.png`, + favicon: `${baseUrl}favicon/favicon-32x32.png`, + copyright: `All rights reserved ${new Date().getFullYear()}, Better Auth Inc.`, + }); - for (const page of blogs.getPages()) { - const url = page.url.replace("blogs/", "blog/"); + for (const page of blogs.getPages()) { + const url = page.url.replace("blogs/", "blog/"); - feed.addItem({ - id: url, - title: page.data.title, - description: page.data.description, - image: page.data.image ? `${baseUrl}${page.data.image.startsWith("/") ? page.data.image.slice(1) : page.data.image}` : undefined, - link: `${baseUrl}${(url.startsWith("/") ? url.slice(1) : url)}`, - date: new Date(page.data.lastModified || page.data.date), - author: page.data.author ? [{ - name: page.data.author.name, - avatar: page.data.author.avatar, - link: page.data.author.twitter, - }] : [], - }); - } + feed.addItem({ + id: url, + title: page.data.title, + description: page.data.description, + image: page.data.image + ? `${baseUrl}${page.data.image.startsWith("/") ? page.data.image.slice(1) : page.data.image}` + : undefined, + link: `${baseUrl}${url.startsWith("/") ? url.slice(1) : url}`, + date: new Date(page.data.lastModified || page.data.date), + author: page.data.author + ? [ + { + name: page.data.author.name, + avatar: page.data.author.avatar, + link: page.data.author.twitter, + }, + ] + : [], + }); + } - return feed.rss2(); + return feed.rss2(); }