From 90fdaa630356e6ace9a320cd03bab403fa347eae Mon Sep 17 00:00:00 2001 From: Pascal Jufer Date: Sun, 29 Oct 2023 04:09:56 +0100 Subject: [PATCH] Fix website export & enhance docs page linking --- iconoir.com/components/Header.tsx | 4 +++- iconoir.com/components/NavigationItem.tsx | 12 ++++++++++-- iconoir.com/next.config.js | 6 +----- iconoir.com/package.json | 1 - 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/iconoir.com/components/Header.tsx b/iconoir.com/components/Header.tsx index aee0dd33..97f7ce53 100644 --- a/iconoir.com/components/Header.tsx +++ b/iconoir.com/components/Header.tsx @@ -32,7 +32,9 @@ export function Header({ currentVersion }: HeaderProps) { Icons - Documentation + + Documentation + Donate — Our Mission diff --git a/iconoir.com/components/NavigationItem.tsx b/iconoir.com/components/NavigationItem.tsx index f645256a..985a3cc3 100644 --- a/iconoir.com/components/NavigationItem.tsx +++ b/iconoir.com/components/NavigationItem.tsx @@ -7,10 +7,16 @@ import { Text15 } from './Typography'; export interface NavigationItemProps { href: string; + activeMatch?: string; children: React.ReactElement | string; style?: any; } -export function NavigationItem({ href, children, style }: NavigationItemProps) { +export function NavigationItem({ + href, + activeMatch, + children, + style, +}: NavigationItemProps) { const router = useRouter(); return ( @@ -20,7 +26,9 @@ export function NavigationItem({ href, children, style }: NavigationItemProps) { style={style} $text={children.toString()} $isActive={ - href.slice(1) + activeMatch + ? router.asPath.startsWith(activeMatch) + : href.slice(1) ? router.asPath.slice(1).startsWith(href.slice(1)) : router.asPath === href } diff --git a/iconoir.com/next.config.js b/iconoir.com/next.config.js index 5fadcf52..88568d36 100644 --- a/iconoir.com/next.config.js +++ b/iconoir.com/next.config.js @@ -1,5 +1,6 @@ /** @type {import('next').NextConfig} */ const nextConfig = { + output: 'export', reactStrictMode: true, compiler: { styledComponents: true, @@ -7,11 +8,6 @@ const nextConfig = { images: { unoptimized: true, }, - async redirects() { - return [ - { source: '/docs', destination: '/docs/introduction', permanent: true }, - ]; - }, }; module.exports = nextConfig; diff --git a/iconoir.com/package.json b/iconoir.com/package.json index d9dd5362..b5e51dc6 100644 --- a/iconoir.com/package.json +++ b/iconoir.com/package.json @@ -4,7 +4,6 @@ "scripts": { "dev": "next dev", "build": "next build", - "export": "next export", "start": "next start", "lint": "next lint" },