This is an automated email from the ASF dual-hosted git repository.

piotr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iggy-website.git


The following commit(s) were added to refs/heads/main by this push:
     new 9f6bdae9 Fix router
9f6bdae9 is described below

commit 9f6bdae992e23714072ce248ff634018538272c2
Author: spetz <[email protected]>
AuthorDate: Tue Feb 10 09:47:56 2026 +0100

    Fix router
---
 next.config.mjs                 |  1 +
 src/components/github-stars.tsx | 22 +++++++++-------------
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/next.config.mjs b/next.config.mjs
index ff8f13b0..1065dcdf 100644
--- a/next.config.mjs
+++ b/next.config.mjs
@@ -5,6 +5,7 @@ const withMDX = createMDX();
 /** @type {import('next').NextConfig} */
 const config = {
   output: "export",
+  trailingSlash: true,
   reactStrictMode: true,
   images: { unoptimized: true },
 };
diff --git a/src/components/github-stars.tsx b/src/components/github-stars.tsx
index 6bc3aea6..57bf098b 100644
--- a/src/components/github-stars.tsx
+++ b/src/components/github-stars.tsx
@@ -3,22 +3,20 @@
 import { useEffect, useState } from "react";
 import Link from "next/link";
 
-function formatStars(count: number): string {
-  if (count >= 1000) {
-    return `${(count / 1000).toFixed(1)}K`;
-  }
-  return String(count);
-}
+const FALLBACK = "3.8K";
 
 export function GitHubStars() {
-  const [stars, setStars] = useState<string | null>(null);
+  const [stars, setStars] = useState(FALLBACK);
 
   useEffect(() => {
     fetch("https://api.github.com/repos/apache/iggy";)
       .then((res) => res.json())
       .then((data) => {
         if (data.stargazers_count) {
-          setStars(formatStars(data.stargazers_count));
+          const count = data.stargazers_count;
+          setStars(
+            count >= 1000 ? `${(count / 1000).toFixed(1)}K` : String(count),
+          );
         }
       })
       .catch(() => {});
@@ -31,11 +29,9 @@ export function GitHubStars() {
       className="inline-flex items-center gap-1.5 rounded-lg border 
border-fd-border bg-fd-secondary/60 px-3 py-1.5 text-sm font-medium 
text-fd-foreground transition-colors hover:bg-fd-accent"
     >
       GitHub{" "}
-      {stars && (
-        <span className="inline-flex items-center gap-1 text-fd-primary">
-          &#9733; {stars}
-        </span>
-      )}
+      <span className="inline-flex items-center gap-1 text-fd-primary">
+        &#9733; {stars}
+      </span>
     </Link>
   );
 }

Reply via email to