Skip to content

Commit

Permalink
chore: pulling
Browse files Browse the repository at this point in the history
  • Loading branch information
tobySolutions committed Oct 15, 2024
1 parent 877ccef commit fe1a9c0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/utils/generateCanonicalUrl.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
export function generateCanonicalUrl(baseUrl: string, slug?: string) {
if (!slug) return baseUrl;

if (slug === 'docs/') {
return `${baseUrl}/${slug}`;
}

return `${baseUrl}/${slug}/`;
return `${baseUrl}/${slug.replace(/\/$/, '')}/`;
}

0 comments on commit fe1a9c0

Please sign in to comment.