File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,12 @@ export async function getStaticPaths() {
2020const { entry } = Astro .props
2121const { Content, remarkPluginFrontmatter } = await render (entry )
2222
23+ // Extract original filename from file path for GitHub edit URL
24+ // entry.id is URL-safe (dots removed), but we need the actual filename
25+ const originalFilename = entry .filePath
26+ ? entry .filePath .split (' /' ).pop ().replace (/ \. mdx? $ / , ' ' )
27+ : entry .id
28+
2329const author = await getEntry (" authors" , getSlug (entry .data .author ))
2430
2531const hasFeatureImage =
@@ -86,7 +92,7 @@ const blogPostSchema = [
8692 authorUrl ={ ` /blog/author/${author .id } ` }
8793 authorAvatar ={ authorImage }
8894 readTime ={ remarkPluginFrontmatter .minutesRead }
89- editUrl ={ GITHUB_URL_WEBSITE + ` / ` + entry . id + ` .md ` }
95+ editUrl ={ GITHUB_URL_WEBSITE + ` / ` + originalFilename + ` .md ` }
9096 />
9197 {
9298 hasFeatureImage && shouldDisplayFeatureImage && (
You can’t perform that action at this time.
0 commit comments