Skip to content

Commit

Permalink
fix(docs): correct URL for edit on github
Browse files Browse the repository at this point in the history
  • Loading branch information
tszhong0411 committed Feb 6, 2025
1 parent 8d934cf commit f6d2390
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions apps/docs/src/app/(main)/[[...slug]]/edit-on-github.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { Link } from '@tszhong0411/ui'
import { EditIcon } from 'lucide-react'

type EditOnGitHubProps = {
path: string
filePath: string
}

const EditOnGitHub = (props: EditOnGitHubProps) => {
const { path } = props
const { filePath } = props

const url = `https://github.com/tszhong0411/honghong.me/blob/main/apps/docs/src/content/${path}.mdx`
const url = `https://github.com/tszhong0411/honghong.me/blob/main/apps/docs/src/content/${filePath}`

return (
<Link href={url} className='inline-flex items-center gap-2 text-sm font-medium' variant='muted'>
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/src/app/(main)/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const Page = async (props: PageProps) => {
notFound()
}

const { title, description, link, code, slug } = doc
const { title, description, link, code, _meta } = doc

const hasLinks = link?.doc !== undefined || link?.api !== undefined

Expand All @@ -90,7 +90,7 @@ const Page = async (props: PageProps) => {
{hasLinks ? <LinkBadges {...link} /> : null}
</div>
<Mdx className='my-12' code={code} />
<EditOnGitHub path={slug} />
<EditOnGitHub filePath={_meta.filePath} />
<DocsNavigation />
</div>
)
Expand Down

0 comments on commit f6d2390

Please sign in to comment.