Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix edit links in docs/ #9252

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.