diff --git a/website/src/app/f/[...path]/page.tsx b/website/src/app/f/[...path]/page.tsx index eb1eea7..aacee63 100644 --- a/website/src/app/f/[...path]/page.tsx +++ b/website/src/app/f/[...path]/page.tsx @@ -8,10 +8,13 @@ import { Box, Divider, Typography, Link, Chip } from "@mui/material"; import { MDXRemote } from "next-mdx-remote/rsc"; import { findType, interpretType } from "@/models/nix"; import { FilterProvider } from "@/components/layout/filterContext"; -import { Suspense } from "react"; +import React, { Suspense } from "react"; import { PositionLink } from "@/components/PositionLink"; import { SearchNav } from "@/components/SearchNav"; +import fs from "fs"; +import path from "path"; + // Important the key ("path") in the returned dict MUST match the dynamic path segment ([...path]) export async function generateStaticParams(): Promise<{ path: string[] }[]> { const paths = data.map((docItem) => { @@ -136,9 +139,6 @@ const MDX = ({ source }: { source: string }) => ( /> ); -import fs from "fs"; -import path from "path"; - async function getManualSrc(item: Doc): Promise { // Path must be at exactly [ "builtins" ":id" ] if (item?.meta?.path?.length != 2 || item?.meta?.path?.[0] !== "builtins") { @@ -201,12 +201,12 @@ export default async function Page(props: { params: { path: string[] } }) { {meta?.path && meta.path.map((attr, idx, all) => idx === all.length - 1 ? ( - <> - - + + + {attr} - + ) : ( ) @@ -372,7 +372,7 @@ export default async function Page(props: { params: { path: string[] } }) { - }> + }> diff --git a/website/src/components/SearchNav.tsx b/website/src/components/SearchNav.tsx index 3a3db35..92a161b 100644 --- a/website/src/components/SearchNav.tsx +++ b/website/src/components/SearchNav.tsx @@ -4,8 +4,6 @@ import { Box, Button, Link, Typography } from "@mui/material"; import { useSessionStorage } from "usehooks-ts"; import { FilterOptions } from "./layout/filterContext"; // import { useRouter } from "next/navigation"; - -// import d from "./example.json"; import { PagefindResult, usePagefindSearch } from "./Pagefind"; import { useEffect, useMemo, useState } from "react"; import { usePathname } from "next/navigation"; @@ -15,10 +13,8 @@ export const SearchNav = () => { "currentFilterOptions", null ); - if (!filterOptions) { - return null; - } - return ; + + return filterOptions && ; }; // const prev = { @@ -63,11 +59,9 @@ export const Navigation = ({ useEffect(() => { const init = async () => { - console.log({ search, term, filters: { from, to } }); if (search) { let raw = (await search(term, { filters: { from, to } }))?.results || []; - let items = await Promise.all(raw.map(async (r) => await r.data())); setItems(items); } diff --git a/website/src/components/filter.tsx b/website/src/components/filter.tsx index 0448a96..0f1ccd7 100644 --- a/website/src/components/filter.tsx +++ b/website/src/components/filter.tsx @@ -125,7 +125,7 @@ export const Filter = (props: FilterProps) => { )} { setFrom(values)} color={"primary"} @@ -176,7 +176,7 @@ export const Filter = (props: FilterProps) => { { setTo(values)} @@ -224,8 +224,12 @@ export const Filter = (props: FilterProps) => { {!disableSubmit && ( <> - )}