mirror of
https://github.com/iconoir-icons/iconoir
synced 2024-06-08 08:52:19 +02:00
Fix website export & enhance docs page linking
This commit is contained in:
parent
9789d64baf
commit
90fdaa6303
|
@ -32,7 +32,9 @@ export function Header({ currentVersion }: HeaderProps) {
|
|||
<HeaderCenter>
|
||||
<MobileMenuContainer $visible={menuVisible}>
|
||||
<NavigationItem href={'/'}>Icons</NavigationItem>
|
||||
<NavigationItem href={'/docs'}>Documentation</NavigationItem>
|
||||
<NavigationItem href={'/docs/introduction'} activeMatch={'/docs'}>
|
||||
Documentation
|
||||
</NavigationItem>
|
||||
<NavigationItem href={'/support'} style={{ marginRight: 0 }}>
|
||||
Donate — Our Mission
|
||||
</NavigationItem>
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"export": "next export",
|
||||
"start": "next start",
|
||||
"lint": "next lint"
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue