Skip to content

Commit 87b705e

Browse files
committed
improve display of documentation index and use a anchor in next link + listitem button
1 parent 0bb1eea commit 87b705e

File tree

3 files changed

+64
-59
lines changed

3 files changed

+64
-59
lines changed

packages/@vulcanjs/next-mui/components/NextMuiButton.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const NextMuiListItemButton = (
4646
const buttonProps = omit(props, nextLinkProps);
4747
return (
4848
<NextLink {...linkProps} passHref>
49-
<ListItemButton {...buttonProps}></ListItemButton>
49+
<ListItemButton component="a" {...buttonProps}></ListItemButton>
5050
</NextLink>
5151
);
5252
};

src/pages/docs/[[...filePath]].tsx

+18-13
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import { MDXRemote, MDXRemoteSerializeResult } from "next-mdx-remote";
22
import { serialize } from "next-mdx-remote/serialize";
33
import path from "path";
44
import { getMdxPaths, MdxPath } from "@vulcanjs/mdx";
5-
import { Link as NextLink } from "@vulcanjs/next-mui";
5+
import {
6+
Link as NextLink,
7+
NextMuiLink,
8+
NextMuiListItemButton,
9+
} from "@vulcanjs/next-mui";
610
import { promises as fsPromises, lstatSync, existsSync } from "fs";
711
import { List, ListItem, Link, Typography } from "@mui/material";
812
import matter from "gray-matter";
@@ -106,18 +110,19 @@ const FolderTableOfContent = ({
106110
{/* Print the subfolders we're in */}
107111
<List>
108112
{pages.map((pageName) => (
109-
<NextLink key={pageName} href={`/docs/${filePath}${pageName}`}>
110-
<ListItem button key={pageName}>
111-
<Typography style={{ textTransform: "capitalize" }}>
112-
{
113-
pageName.replace(
114-
/-/g,
115-
" "
116-
) /* we don't use the front matter of the file at this point to simplify loading, so we have to cleanup the name manually */
117-
}
118-
</Typography>
119-
</ListItem>
120-
</NextLink>
113+
<NextMuiListItemButton
114+
key={pageName}
115+
href={`/docs/${filePath}${pageName}`}
116+
>
117+
<Typography style={{ textTransform: "capitalize" }}>
118+
{
119+
pageName.replace(
120+
/-/g,
121+
" "
122+
) /* we don't use the front matter of the file at this point to simplify loading, so we have to cleanup the name manually */
123+
}
124+
</Typography>
125+
</NextMuiListItemButton>
121126
))}
122127
<hr></hr>
123128
<PreviousPageLink filePath={filePath} />

yarn.lock

+45-45
Original file line numberDiff line numberDiff line change
@@ -4361,12 +4361,12 @@
43614361
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.30.0.tgz#e940f5cfe30dfd0b7b30c4d7f9f6f00fcf754577"
43624362
integrity sha512-16ePj2GkwjomvE0HLL5ny+d+sudOwvZNYW8vjpMh3cyWdFxoMI8KSQiolVxeHBULbU1C5mVxLK5nL9NtnnpIew==
43634363

4364-
"@vulcanjs/core@^0.4.3":
4365-
version "0.4.3"
4366-
resolved "https://registry.yarnpkg.com/@vulcanjs/core/-/core-0.4.3.tgz#22e0fe3551922c2b45cc5eafba665e6dfa5dccee"
4367-
integrity sha512-lP9EoPvDRtAcV09VdFtd7hLMmsb+L0JCvtBRYlEGF5a2V/LiLTlcli6CqVsGYjjKZ54LOyW4wCaQ/F3Vm4lxyA==
4364+
"@vulcanjs/core@^0.4.4":
4365+
version "0.4.4"
4366+
resolved "https://registry.yarnpkg.com/@vulcanjs/core/-/core-0.4.4.tgz#4eec3dda3e3280244a53601cce5a55d1465db7dc"
4367+
integrity sha512-4mS1gHVSkyYkzlinad7mfotcj+XVSWuB1Frw1fjO9Z/JiX2h5oEcKd+B4QbSdkSJtEfZ6BE2KSkGOPBCWnG69A==
43684368
dependencies:
4369-
"@vulcanjs/utils" "^0.4.3"
4369+
"@vulcanjs/utils" "^0.4.4"
43704370
debug "^4.3.1"
43714371
lodash "^4.17.21"
43724372

@@ -4375,17 +4375,17 @@
43754375
resolved "https://registry.yarnpkg.com/@vulcanjs/demo/-/demo-0.4.0.tgz#7504a702eb309777336f7e020ba36d70d0a39fab"
43764376
integrity sha512-PylbnJMLhMxzpNrWCSz24rleQvUpPHINQYlbTk5UG3L92IncxHIR1jxSUQdfQa1DVqVQkxZ+clW1xMhFPcYccw==
43774377

4378-
"@vulcanjs/graphql@^0.4.0", "@vulcanjs/graphql@^0.4.3":
4379-
version "0.4.3"
4380-
resolved "https://registry.yarnpkg.com/@vulcanjs/graphql/-/graphql-0.4.3.tgz#5000f867c01a163a36bbf7e46d85fc84dac17e6d"
4381-
integrity sha512-1wSCopHRNl5dlY3yDN44XYZQThINZ5Jwhsf9Jo/1cnZCcJcOaUiEddjhsVxjXM52XFA+j8F6441tJJDGg96pdQ==
4378+
"@vulcanjs/graphql@^0.4.0", "@vulcanjs/graphql@^0.4.4":
4379+
version "0.4.4"
4380+
resolved "https://registry.yarnpkg.com/@vulcanjs/graphql/-/graphql-0.4.4.tgz#f7b2b81bc0e609c46e68901bc8e0f51c6ac3b4ae"
4381+
integrity sha512-SK3snLoN/n6SYtP/WkapYhysbjoBQC2wC2Qc5kRJyqimiY1q4C0TITePa8sTZueWVQDzO5KdtMjObxGtM/gyfw==
43824382
dependencies:
4383-
"@vulcanjs/core" "^0.4.3"
4384-
"@vulcanjs/i18n" "^0.4.3"
4383+
"@vulcanjs/core" "^0.4.4"
4384+
"@vulcanjs/i18n" "^0.4.4"
43854385
"@vulcanjs/model" "^0.4.1"
43864386
"@vulcanjs/permissions" "^0.4.2"
43874387
"@vulcanjs/schema" "^0.4.1"
4388-
"@vulcanjs/utils" "^0.4.3"
4388+
"@vulcanjs/utils" "^0.4.4"
43894389
debug "^4.3.1"
43904390
deepmerge "^4.2.2"
43914391
graphql-date "^1.0.3"
@@ -4395,13 +4395,13 @@
43954395
optionalDependencies:
43964396
msw "^0.35.0"
43974397

4398-
"@vulcanjs/i18n@^0.4.3":
4399-
version "0.4.3"
4400-
resolved "https://registry.yarnpkg.com/@vulcanjs/i18n/-/i18n-0.4.3.tgz#989b6caa557639d642e87a565268abcfd6023d56"
4401-
integrity sha512-8zFJghRmMDjGNmVcQE7IxgYeOD45M087pbLOzf0jvRwRYcDI0YhbbHx+Y+vg1bx6SK85HnS1KSEb0iWT+uH0kw==
4398+
"@vulcanjs/i18n@^0.4.4":
4399+
version "0.4.4"
4400+
resolved "https://registry.yarnpkg.com/@vulcanjs/i18n/-/i18n-0.4.4.tgz#9c06ecb6b25e06d3de43b52f51c5d79d6d81cde6"
4401+
integrity sha512-A4S6LnaYIGy2NAhYqODTQNEbfvtz/hW00izzJiZEUDMpEgivH/RkaP6ODoi3nA1aMquSmBI7Rmf1OmmgXFx1Gg==
44024402
dependencies:
44034403
"@vulcanjs/schema" "^0.4.1"
4404-
"@vulcanjs/utils" "^0.4.3"
4404+
"@vulcanjs/utils" "^0.4.4"
44054405
prop-types "^15.7.2"
44064406
simpl-schema "^1.12.0"
44074407

@@ -4411,11 +4411,11 @@
44114411
integrity sha512-KWt/t/Q/jsp7y4Jmaz66IWoYhEC32JFqHugr3A94j3CU292DERfuNVw9Aw4DBZ6rqhlRSZl47WFl2AqyYrTUoQ==
44124412

44134413
"@vulcanjs/meteor-legacy@^0.4.0":
4414-
version "0.4.3"
4415-
resolved "https://registry.yarnpkg.com/@vulcanjs/meteor-legacy/-/meteor-legacy-0.4.3.tgz#cfa49cd7d77ad9a116c372e8d5ae4109d06a6099"
4416-
integrity sha512-U0f8dQs5IxqxuySJVNSzGFithJoyEzo9qLnXAzcPjYh1Ck9waM2wqpc0MRYRHkRgofh6Ssjy6by+FFcPkZkQDQ==
4414+
version "0.4.4"
4415+
resolved "https://registry.yarnpkg.com/@vulcanjs/meteor-legacy/-/meteor-legacy-0.4.4.tgz#181c316dfd50c652692f533ed36fe58a0734e2e6"
4416+
integrity sha512-B3sLLVpdv7uY/f9YePX1+lkYvKFJselbfIzQolPVxonqkQg14CgkYtmfn6HAoBY2Uko7suW/Gr5pBgMfruGU9A==
44174417
dependencies:
4418-
"@vulcanjs/graphql" "^0.4.3"
4418+
"@vulcanjs/graphql" "^0.4.4"
44194419
lodash "^4.17.21"
44204420

44214421
"@vulcanjs/model@^0.4.1":
@@ -4425,14 +4425,14 @@
44254425
dependencies:
44264426
"@vulcanjs/schema" "^0.4.1"
44274427

4428-
"@vulcanjs/mongo@^0.4.0", "@vulcanjs/mongo@^0.4.3":
4429-
version "0.4.3"
4430-
resolved "https://registry.yarnpkg.com/@vulcanjs/mongo/-/mongo-0.4.3.tgz#11c153ae13e5b947502af9c864c6ebceb59a9492"
4431-
integrity sha512-8TJziXPwkElKvNPRhq5YlS7FjWVcm05z+TeP4/dHhtEE8Aj0ak0ygqrcjL9JHJNywiX2Kid6AoxKVlZ8F3KU3A==
4428+
"@vulcanjs/mongo@^0.4.0", "@vulcanjs/mongo@^0.4.4":
4429+
version "0.4.4"
4430+
resolved "https://registry.yarnpkg.com/@vulcanjs/mongo/-/mongo-0.4.4.tgz#5861c673e8311f0bf7d9f0438dbd9b5d47524061"
4431+
integrity sha512-7KWosnlmobn3tXwrWEwFrPepVUxdepU2ElMz2i1xZS0g+MtBSO5+w07RTerOMiWunUKYjfMg6dfKagwUZlpQhQ==
44324432
dependencies:
4433-
"@vulcanjs/graphql" "^0.4.3"
4433+
"@vulcanjs/graphql" "^0.4.4"
44344434
"@vulcanjs/model" "^0.4.1"
4435-
"@vulcanjs/utils" "^0.4.3"
4435+
"@vulcanjs/utils" "^0.4.4"
44364436
escape-string-regexp "4.0.0"
44374437
lodash "^4.17.20"
44384438

@@ -4445,31 +4445,31 @@
44454445
"@vulcanjs/schema" "^0.4.1"
44464446
lodash "^4.17.21"
44474447

4448-
"@vulcanjs/react-hooks@^0.4.0", "@vulcanjs/react-hooks@^0.4.3":
4449-
version "0.4.3"
4450-
resolved "https://registry.yarnpkg.com/@vulcanjs/react-hooks/-/react-hooks-0.4.3.tgz#afa56525f6b3627287d659142e9474c2f49e8ede"
4451-
integrity sha512-8nroBRlIVcixSXq/lw00NMZ5hpimNShdkmthmU9JeDwo8oW7Aq+brEG4HrYjqM1FyNEJLeQK9JYeMLRmeyl5Ug==
4448+
"@vulcanjs/react-hooks@^0.4.0", "@vulcanjs/react-hooks@^0.4.4":
4449+
version "0.4.4"
4450+
resolved "https://registry.yarnpkg.com/@vulcanjs/react-hooks/-/react-hooks-0.4.4.tgz#524b4e5069a004b74ba9b87ab32b0f2a81cbd2d7"
4451+
integrity sha512-KJKAnSCad5juas4IY3xeO7WExiEyrALVIJhJhB7roZPptCjYpB2PerIys32/xxDl1tuQua6/qStwQGjfNl9Plg==
44524452
dependencies:
4453-
"@vulcanjs/graphql" "^0.4.3"
4454-
"@vulcanjs/mongo" "^0.4.3"
4453+
"@vulcanjs/graphql" "^0.4.4"
4454+
"@vulcanjs/mongo" "^0.4.4"
44554455
debug "^4.3.1"
44564456
graphql "^15.5.0"
44574457
lodash "^4.17.20"
44584458
mingo "^3.0.6"
44594459

44604460
"@vulcanjs/react-ui@^0.4.2":
4461-
version "0.4.3"
4462-
resolved "https://registry.yarnpkg.com/@vulcanjs/react-ui/-/react-ui-0.4.3.tgz#55e585a0f2d3d321fc99fcab9501c0ab8fee4a75"
4463-
integrity sha512-K3/v2pfz7Cr1X9PE6PDCSaSYC3lNhvKla12GSS1gc8uDIu2Mdr0CSRD5F+OxnzgdFnRD+zepKoAkFYguhNAwaA==
4461+
version "0.4.4"
4462+
resolved "https://registry.yarnpkg.com/@vulcanjs/react-ui/-/react-ui-0.4.4.tgz#da7cac3e50626c8f9ecba3f29c9afbc09bd79021"
4463+
integrity sha512-0iD/8zMHkHC+mAPeQbCXJbWmr9e9mfZtrx7b9iMyoJunZMJYEL33uCfocZ4vATBRGwfzoohQawdJVjy/QjUBTw==
44644464
dependencies:
4465-
"@vulcanjs/core" "^0.4.3"
4466-
"@vulcanjs/graphql" "^0.4.3"
4467-
"@vulcanjs/i18n" "^0.4.3"
4465+
"@vulcanjs/core" "^0.4.4"
4466+
"@vulcanjs/graphql" "^0.4.4"
4467+
"@vulcanjs/i18n" "^0.4.4"
44684468
"@vulcanjs/model" "^0.4.1"
44694469
"@vulcanjs/permissions" "^0.4.2"
4470-
"@vulcanjs/react-hooks" "^0.4.3"
4470+
"@vulcanjs/react-hooks" "^0.4.4"
44714471
"@vulcanjs/schema" "^0.4.1"
4472-
"@vulcanjs/utils" "^0.4.3"
4472+
"@vulcanjs/utils" "^0.4.4"
44734473
classnames "^2.3.1"
44744474
debug "^4.3.1"
44754475
lodash "^4.17.21"
@@ -4483,10 +4483,10 @@
44834483
lodash "^4.17.21"
44844484
simpl-schema "^1.12.0"
44854485

4486-
"@vulcanjs/utils@^0.4.3":
4487-
version "0.4.3"
4488-
resolved "https://registry.yarnpkg.com/@vulcanjs/utils/-/utils-0.4.3.tgz#c816513ffc01ece78b41a454ffec1df86b037c1d"
4489-
integrity sha512-StNrLTgH2z44KlKtKQUdCqfCdqWK8Ku3k8rTByTEvCBPQmXPeMVJ7cPQRowi2GM4tohZ/nQ/bJy7oDV6LEmIDQ==
4486+
"@vulcanjs/utils@^0.4.4":
4487+
version "0.4.4"
4488+
resolved "https://registry.yarnpkg.com/@vulcanjs/utils/-/utils-0.4.4.tgz#59432561fdf28dd6592d2a4a5777570bfd0d6073"
4489+
integrity sha512-E+hEQRqeOwAA7cCiarF4MU7ipph4UD0eoFCixKTdtlMmYMP64xzoYoPQk2vgOd0Uu/IdVnlMaItbyRne9RmU5A==
44904490
dependencies:
44914491
"@vulcanjs/model" "^0.4.1"
44924492
debug "^4.3.1"

0 commit comments

Comments
 (0)