Skip to content

Commit

Permalink
Fix edit links in docs/ (#9252)
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Vrachliotis <[email protected]>
  • Loading branch information
kennedybaird and simonswiss authored Aug 5, 2024
1 parent 1a9ff0a commit 9c27c75
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 90 deletions.
2 changes: 1 addition & 1 deletion docs/app/(site)/blog/[post]/page-client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function Page ({ post }: { post: BlogPost }) {
const formattedDateStr = format(parsedDate, 'MMMM do, yyyy')

return (
<BlogPage headings={headings} editPath={`docs/${params?.post}.md`}>
<BlogPage headings={headings} editPath={`blog/${params?.post}.md`}>
<Heading level={1} id="title" css={{ marginBottom: 0 }}>
{post.title}
</Heading>
Expand Down
2 changes: 1 addition & 1 deletion docs/app/(site)/docs/config/overview/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const metadata = {

export default function Docs () {
return (
<DocsLayout noRightNav noProse isIndexPage editPath="docs/config/overview.tsx">
<DocsLayout noRightNav noProse isIndexPage>
<PageClient />
</DocsLayout>
)
Expand Down
2 changes: 1 addition & 1 deletion docs/app/(site)/docs/examples/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function getGroupedExamples () {
export default async function Docs () {
const pageData = await getGroupedExamples()
return (
<DocsLayout noRightNav noProse editPath={'docs/examples.tsx'}>
<DocsLayout noRightNav noProse isIndexPage>
<PageClient {...JSON.parse(JSON.stringify(pageData))} />
</DocsLayout>
)
Expand Down
2 changes: 1 addition & 1 deletion docs/app/(site)/docs/guides/document-field-demo/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function DocumentFieldDemo () {
id: 'related-resources',
},
]}
editPath="docs/guides/document-field-demo.tsx"
isIndexPage
>
<PageClient />
</DocsLayout>
Expand Down
2 changes: 1 addition & 1 deletion docs/app/(site)/docs/guides/overview/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const metadata = {

export default function Docs () {
return (
<DocsLayout noRightNav noProse isIndexPage editPath="docs/guides/overview.tsx">
<DocsLayout noRightNav noProse isIndexPage>
<PageClient />
</DocsLayout>
)
Expand Down
2 changes: 1 addition & 1 deletion docs/app/(site)/docs/walkthroughs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default async function Docs () {
const [quickstart, ...walkthroughs] = featuredDocs.items

return (
<DocsLayout noRightNav noProse isIndexPage editPath="docs/walkthroughs/index.tsx">
<DocsLayout noRightNav noProse isIndexPage>
<PageClient
quickstart={JSON.parse(JSON.stringify(quickstart))}
walkthroughs={JSON.parse(JSON.stringify(walkthroughs))}
Expand Down
2 changes: 1 addition & 1 deletion docs/app/(site)/updates/roadmap/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const metadata = {

export default function Roadmap () {
return (
<DocsLayout noRightNav noProse>
<DocsLayout noRightNav noProse isIndexPage>
<PageClient />
</DocsLayout>
)
Expand Down
6 changes: 3 additions & 3 deletions docs/components/primitives/EditButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ export function EditButton ({
isIndexPage?: boolean
editPath?: string
}) {
let fileUrl = `https://github.com/keystonejs/keystone/edit/main/docs/pages`
let fileUrl = `https://github.com/keystonejs/keystone/edit/main/docs`

if (editPath) {
fileUrl += `/${editPath}`
fileUrl += `/content/${editPath}`
} else if (isIndexPage) {
fileUrl += `${pathName}/index.tsx`
fileUrl += `/app/(site)${pathName}/page-client.tsx`
} else {
fileUrl += `${pathName}.md`
}
Expand Down
160 changes: 80 additions & 80 deletions docs/public/sitemap-0.xml

Large diffs are not rendered by default.

0 comments on commit 9c27c75

Please sign in to comment.