Skip to content

Commit

Permalink
change the default depth of the table of contents
Browse files Browse the repository at this point in the history
  • Loading branch information
vanyauhalin committed Jul 12, 2024
1 parent 9e65643 commit 7e0e3e8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion site/internal/table-of-contents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface TableOfContentsProperties {

export function TableOfContents(p: TableOfContentsProperties): JSX.Element {
const s = Sitemap.shared
const {depth = 1} = p
const {depth = -1} = p
const e = s.find(p.url, "url")
if (!e) {
return <></>
Expand Down
2 changes: 1 addition & 1 deletion site/layouts/service-declaration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function render(ctx: Context): JSX.Element {
switch (d.kind) {
case "group":
// todo: move to the ServiceDeclaration
return <TableOfContents url={ctx.page.url} />
return <TableOfContents url={ctx.page.url} depth={1} />
case "request":
return <ServiceDeclaration
declaration={d}
Expand Down
2 changes: 1 addition & 1 deletion site/pages/Sitemap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export function data(): Data {

export function render(): JSX.Element {
return <Content>
<TableOfContents url="/" depth={-1} />
<TableOfContents url="/" />
</Content>
}

0 comments on commit 7e0e3e8

Please sign in to comment.