Skip to content

Commit

Permalink
fix: help find more edit page links
Browse files Browse the repository at this point in the history
  • Loading branch information
steveoh committed Mar 28, 2024
1 parent 1340ad5 commit eaa226e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/Footer.astro
Expand Up @@ -10,9 +10,13 @@ const sha = import.meta.env.COMMIT_REF?.substring(0, 8) ?? 'dev';
const formatUrl = (path: string) => {
path = path.replace(/\/$/, '');
if (path === '') {
path = '/index';
}
if (path.includes('/blog/')) {
path = path.replace('/blog/', 'content/blog/');
return `pages${path}.md`;
path = path.replace('/blog/', '/content/blog/');
return `${path}.md`;
} else {
return `pages${path}.astro`;
}
Expand Down

0 comments on commit eaa226e

Please sign in to comment.