Skip to content

Commit

Permalink
Update pageDirname parameter in Layout component
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Feb 9, 2024
1 parent 8efb18c commit 9943e5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion website/layouts/doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default async function Layout({ children, pageDirname, params, toc, prose
<PageNavs metadata={props.metadata} pages={pages} />
<DocFooter locale={params.locale} />
</DocMain>
{toc && <PageContent locale={params.locale} metadata={props.metadata} lastCommit={await fetchLastCommit(pageDirname, project)}>{toc}</PageContent>}
{toc && <PageContent locale={params.locale} metadata={props.metadata} pageDirname={pageDirname} lastCommit={await fetchLastCommit(pageDirname, project)}>{toc}</PageContent>}
</>
)
}
7 changes: 2 additions & 5 deletions website/layouts/reference.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ import DocFooter from '../components/DocFooter'
import PageNavs from 'websites/components/PageNavs'
import pages from '../app/[locale]/(root)/pages'
import PageContent from 'websites/components/PageContent'
import parentModule from 'parent-module'
import fetchLastCommit from 'websites/utils/fetch-last-commit'
import project from '~/project'

const pageSourcePath = parentModule()

export default async function Layout({ children, params, toc, $hideLeftSide, ...props }: any) {
export default async function Layout({ children, pageDirname, params, toc, $hideLeftSide, ...props }: any) {
return <>
<DocMain $hideRightSide={!toc} $hideLeftSide={$hideLeftSide}>
<Article>
Expand All @@ -21,6 +18,6 @@ export default async function Layout({ children, params, toc, $hideLeftSide, ...
<PageNavs metadata={props.metadata} pages={pages} />
<DocFooter locale={params.locale} />
</DocMain>
{toc && <PageContent locale={params.locale} metadata={props.metadata} lastCommit={await fetchLastCommit(pageSourcePath, project)}>{toc}</PageContent>}
{toc && <PageContent locale={params.locale} metadata={props.metadata} pageDirname={pageDirname} lastCommit={await fetchLastCommit(pageDirname, project)}>{toc}</PageContent>}
</>
}

0 comments on commit 9943e5a

Please sign in to comment.