Skip to content

Commit

Permalink
fix(BaseLayout): adjust on process of generate ogImagePath to handle …
Browse files Browse the repository at this point in the history
…with '/' in last character
  • Loading branch information
Robert Damaceno Santos committed Aug 11, 2023
1 parent 4b1d6ce commit 568ce02
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ui/layouts/BaseLayout/BaseLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ const CURRENT_URL = Astro.url.href;
const CURRENT_PATHNAME = Astro.url.pathname;
const ogImagePath =
CURRENT_PATHNAME.replace(/^\/(.+)?\/?$/, "$1").replace("/", "-") || "index"; //path where og image is auto-generated in build process
CURRENT_PATHNAME.replace(/^\/(.+)?\/?$/, "$1")
.replace(/\//g, "-")
.replace(/[^a-zA-Z0-9]$/, "") || "index"; //path where og image is auto-generated in build process
---

<html lang="en">
Expand Down

0 comments on commit 568ce02

Please sign in to comment.