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>
|
<HeaderCenter>
|
||||||
<MobileMenuContainer $visible={menuVisible}>
|
<MobileMenuContainer $visible={menuVisible}>
|
||||||
<NavigationItem href={'/'}>Icons</NavigationItem>
|
<NavigationItem href={'/'}>Icons</NavigationItem>
|
||||||
<NavigationItem href={'/docs'}>Documentation</NavigationItem>
|
<NavigationItem href={'/docs/introduction'} activeMatch={'/docs'}>
|
||||||
|
Documentation
|
||||||
|
</NavigationItem>
|
||||||
<NavigationItem href={'/support'} style={{ marginRight: 0 }}>
|
<NavigationItem href={'/support'} style={{ marginRight: 0 }}>
|
||||||
Donate — Our Mission
|
Donate — Our Mission
|
||||||
</NavigationItem>
|
</NavigationItem>
|
||||||
|
|
|
@ -7,10 +7,16 @@ import { Text15 } from './Typography';
|
||||||
|
|
||||||
export interface NavigationItemProps {
|
export interface NavigationItemProps {
|
||||||
href: string;
|
href: string;
|
||||||
|
activeMatch?: string;
|
||||||
children: React.ReactElement | string;
|
children: React.ReactElement | string;
|
||||||
style?: any;
|
style?: any;
|
||||||
}
|
}
|
||||||
export function NavigationItem({ href, children, style }: NavigationItemProps) {
|
export function NavigationItem({
|
||||||
|
href,
|
||||||
|
activeMatch,
|
||||||
|
children,
|
||||||
|
style,
|
||||||
|
}: NavigationItemProps) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -20,7 +26,9 @@ export function NavigationItem({ href, children, style }: NavigationItemProps) {
|
||||||
style={style}
|
style={style}
|
||||||
$text={children.toString()}
|
$text={children.toString()}
|
||||||
$isActive={
|
$isActive={
|
||||||
href.slice(1)
|
activeMatch
|
||||||
|
? router.asPath.startsWith(activeMatch)
|
||||||
|
: href.slice(1)
|
||||||
? router.asPath.slice(1).startsWith(href.slice(1))
|
? router.asPath.slice(1).startsWith(href.slice(1))
|
||||||
: router.asPath === href
|
: router.asPath === href
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
|
output: 'export',
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
compiler: {
|
compiler: {
|
||||||
styledComponents: true,
|
styledComponents: true,
|
||||||
|
@ -7,11 +8,6 @@ const nextConfig = {
|
||||||
images: {
|
images: {
|
||||||
unoptimized: true,
|
unoptimized: true,
|
||||||
},
|
},
|
||||||
async redirects() {
|
|
||||||
return [
|
|
||||||
{ source: '/docs', destination: '/docs/introduction', permanent: true },
|
|
||||||
];
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = nextConfig;
|
module.exports = nextConfig;
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"export": "next export",
|
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue