diff --git a/.prettierrc.js b/.prettierrc.js index 8bc336a..b48f2c3 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -17,4 +17,4 @@ module.exports = { proseWrap: 'preserve', htmlWhitespaceSensitivity: 'css', endOfLine: 'lf' -}; +} diff --git a/projects/fastgpt/app/[[...lang]]/page.tsx b/projects/fastgpt/app/[[...lang]]/page.tsx index dd1f199..f7256e5 100644 --- a/projects/fastgpt/app/[[...lang]]/page.tsx +++ b/projects/fastgpt/app/[[...lang]]/page.tsx @@ -18,12 +18,20 @@ export default async function LangHome({ lang && lang[0] && lang[0] !== "index" ? lang[0] : defaultLocale; const dict = await getDictionary(langName); + let stars = 13 * 1000; + try { + const { stargazers_count } = await ( + await fetch('https://api.github.com/repos/labring/FastGPT') + ).json(); + stars = stargazers_count; + } catch (error) {} + return ( <>
{/* Hero Section */} - + {/* Can be used to display technology stack, partners, project honors, etc. */} {/**/} @@ -41,7 +49,7 @@ export default async function LangHome({ {/* CTA (Call to Action) */} - +
); diff --git a/projects/fastgpt/components/home/CTA.tsx b/projects/fastgpt/components/home/CTA.tsx index 8c6eb83..0a09e05 100644 --- a/projects/fastgpt/components/home/CTA.tsx +++ b/projects/fastgpt/components/home/CTA.tsx @@ -2,7 +2,7 @@ import CTAButton from "@/components/home/CTAButton"; import { RoughNotation } from "react-rough-notation"; -const CTA = ({ locale, CTALocale }: { locale: any; CTALocale: any }) => { +const CTA = ({ locale, CTALocale,stars }: { locale: any; CTALocale: any; stars:number }) => { return (
@@ -22,7 +22,7 @@ const CTA = ({ locale, CTALocale }: { locale: any; CTALocale: any }) => { {locale.description6}

- +
); }; diff --git a/projects/fastgpt/components/home/CTAButton.tsx b/projects/fastgpt/components/home/CTAButton.tsx index 22fcbe2..ec2b0ec 100644 --- a/projects/fastgpt/components/home/CTAButton.tsx +++ b/projects/fastgpt/components/home/CTAButton.tsx @@ -2,7 +2,7 @@ import { Button } from "@/components/ui/button"; import { RocketIcon } from "lucide-react"; import Link from "next/link"; -const CTAButton = ({ locale }: { locale: any }) => { +const CTAButton = ({ locale,stars }: { locale: any;stars:number }) => { return (
{ >
diff --git a/projects/fastgpt/components/home/Hero.tsx b/projects/fastgpt/components/home/Hero.tsx index 12afe55..0d3e0f7 100644 --- a/projects/fastgpt/components/home/Hero.tsx +++ b/projects/fastgpt/components/home/Hero.tsx @@ -3,7 +3,7 @@ import { LineText } from "@/components/LineText"; import CTAButton from "@/components/home/CTAButton"; import { motion } from "framer-motion"; -const Hero = ({ locale, CTALocale }: { locale: any; CTALocale: any }) => { +const Hero = ({ locale, CTALocale,stars }: { locale: any; CTALocale: any;stars:number }) => { return ( <> {

- + ); }; diff --git a/projects/fastgpt/config/site.ts b/projects/fastgpt/config/site.ts index ed8aaa3..bd2810a 100644 --- a/projects/fastgpt/config/site.ts +++ b/projects/fastgpt/config/site.ts @@ -64,7 +64,7 @@ export const siteConfig: SiteConfig = { card: "summary_large_image", title: baseSiteConfig.name, description: baseSiteConfig.description, - images: [`${baseSiteConfig.url}/og.png`], + images: [`${baseSiteConfig.url}/og.png?${new Date().getTime()}`], creator: baseSiteConfig.creator, }, } diff --git a/projects/fastgpt/middleware.ts b/projects/fastgpt/middleware.ts deleted file mode 100644 index 90424ff..0000000 --- a/projects/fastgpt/middleware.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { locales } from "./lib/i18n"; - -import { NextRequest } from "next/server"; - -export function middleware(request: NextRequest) { - const { pathname } = request.nextUrl; - - const isExit = locales.some( - (locale) => pathname.startsWith(`/${locale}/`) || pathname === `/${locale}` - ); - - if (isExit) return; - - request.nextUrl.pathname = `/`; - return Response.redirect(request.nextUrl); -} - -export const config = { - matcher: ["/((?!_next)(?!.*\\.(?:ico|png|svg|jpg|jpeg|xml|txt)$)(?!/api).*)"], -};