This repository was archived by the owner on Jan 24, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
gatsby-theme-docz/src/components/NavLink Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ export class Entry {
39
39
public readonly fullpath : string
40
40
public readonly headings : Heading [ ]
41
41
public readonly id : string
42
+ public readonly hidden : boolean
42
43
public readonly menu : string | null
43
44
public readonly name : string
44
45
public readonly route : string
@@ -57,6 +58,7 @@ export class Entry {
57
58
this . filepath = filepath
58
59
this . fullpath = path . resolve ( root , file )
59
60
this . link = ''
61
+ this . hidden = parsed . hidden || false
60
62
this . slug = this . slugify ( filepath , config . separator )
61
63
this . route = this . getRoute ( parsed )
62
64
this . name = name
Original file line number Diff line number Diff line change @@ -22,9 +22,14 @@ const getCurrentHash = () => {
22
22
23
23
export const NavLink = React . forwardRef ( ( { item, ...props } , ref ) => {
24
24
const docs = useDocs ( )
25
+ const current = useCurrentDoc ( )
26
+
27
+ if ( item . hidden ) {
28
+ return null
29
+ }
30
+
25
31
const to = item . route
26
32
const headings = docs && getHeadings ( to , docs )
27
- const current = useCurrentDoc ( )
28
33
const isCurrent = item . route === current . route
29
34
const showHeadings = isCurrent && headings && headings . length > 0
30
35
const currentHash = getCurrentHash ( )
You can’t perform that action at this time.
0 commit comments