From 7cbc696ef4e325da05f4fb05bb8676bebd624f30 Mon Sep 17 00:00:00 2001 From: 0-Sandy Date: Sat, 7 Mar 2026 11:20:22 -0300 Subject: [PATCH] style: format code --- landing/app/blog/rss.xml/route.ts | 2 +- landing/lib/rss.ts | 68 ++++++++++++++++--------------- landing/lib/utils.ts | 2 +- 3 files changed, 38 insertions(+), 34 deletions(-) diff --git a/landing/app/blog/rss.xml/route.ts b/landing/app/blog/rss.xml/route.ts index a5d5466f8e..2c7245cdf9 100644 --- a/landing/app/blog/rss.xml/route.ts +++ b/landing/app/blog/rss.xml/route.ts @@ -8,4 +8,4 @@ export function GET() { "Content-Type": "application/rss+xml; charset=utf-8", }, }); -} \ No newline at end of file +} diff --git a/landing/lib/rss.ts b/landing/lib/rss.ts index 9662526156..32111fd9f1 100644 --- a/landing/lib/rss.ts +++ b/landing/lib/rss.ts @@ -3,39 +3,43 @@ 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().sort((a, b) => { - return new Date(b.data.date).getTime() - new Date(a.data.date).getTime(); - })) { - const url = page.url.replace("blogs/", "blog/"); + for (const page of blogs.getPages().sort((a, b) => { + return new Date(b.data.date).getTime() - new Date(a.data.date).getTime(); + })) { + const url = page.url.replace("blogs/", "blog/"); - feed.addItem({ - id: page.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: page.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(); } diff --git a/landing/lib/utils.ts b/landing/lib/utils.ts index 229762355d..8a90058be7 100644 --- a/landing/lib/utils.ts +++ b/landing/lib/utils.ts @@ -26,4 +26,4 @@ export const baseUrl = ? new URL("http://localhost:3000") : new URL( `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL || process.env.VERCEL_URL}`, - ); \ No newline at end of file + );