📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
fix: docs infinite redirects
Blue Mousef4ebc4fcb8f9
diff --git a/docs/app/components/Footer.tsx b/docs/app/components/Footer.tsxindex d9611f30a..833e6e386 100644--- a/docs/app/components/Footer.tsx+++ b/docs/app/components/Footer.tsx@@ -343,7 +343,7 @@ export default function Footer() {className="-translate-y-px"height={28}width={24}- src="/img/logo/white.png"+ src="/docs/img/logo/white.png"alt=""loading="lazy"/>diff --git a/docs/app/layout.tsx b/docs/app/layout.tsxindex 7c1f1bbc2..6744a0217 100644--- a/docs/app/layout.tsx+++ b/docs/app/layout.tsx@@ -41,14 +41,14 @@ export default function RootLayout({ children }: { children: ReactNode }) {className="-translate-y-px dark:hidden"height="28"width="24"- src="/img/logo/blue.png"+ src="/docs/img/logo/blue.png"alt=""/><imgclassName="-translate-y-px hidden dark:block"height="28"width="24"- src="/img/logo/white.png"+ src="/docs/img/logo/white.png"alt=""/><span className="text-2xl leading-5 font-bold text-slate-900 dark:text-white">diff --git a/docs/mdx-components.tsx b/docs/mdx-components.tsxindex b65e66368..18b44447f 100644--- a/docs/mdx-components.tsx+++ b/docs/mdx-components.tsx@@ -5,10 +5,23 @@ import { Tab, Tabs } from "fumadocs-ui/components/tabs";import { Accordion, Accordions } from "fumadocs-ui/components/accordion";import { File, Folder, Files } from "fumadocs-ui/components/files";import type { MDXComponents } from "mdx/types";+import type { ImgHTMLAttributes } from "react";++const BASE_PATH = "/docs";++function Img(props: ImgHTMLAttributes<HTMLImageElement>) {+ const raw = props.src;+ const src =+ typeof raw === "string" && raw.startsWith("/") && !raw.startsWith(BASE_PATH)+ ? `${BASE_PATH}${raw}`+ : raw;+ return <img {...props} src={src} />;+}export function getMDXComponents(components?: MDXComponents): MDXComponents {return {...defaultMdxComponents,+ img: Img,Callout,Step,Steps,diff --git a/docs/next.config.mjs b/docs/next.config.mjsindex c12ab4605..f23309838 100644--- a/docs/next.config.mjs+++ b/docs/next.config.mjs@@ -4,6 +4,7 @@ const withMDX = createMDX();/** @type {import('next').NextConfig} */const config = {+ basePath: "/docs",reactStrictMode: true,turbopack: {root: import.meta.dirname,