Skip to content

Commit

Permalink
add trailing slash
Browse files Browse the repository at this point in the history
  • Loading branch information
gvkhna committed May 31, 2024
1 parent 9f8c9c6 commit d67c6b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/partials/site/examples-section.astro
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ const pathname = Astro.url.pathname
<div class='mb-4 flex items-center'>
{
Examples.map((item) => {
if (pathname === `/examples/${item.id}` || (item.default === true && pathname === '/')) {
if (pathname.startsWith(`/examples/${item.id}`) || (item.default === true && pathname === '/')) {
return (
<a
class='flex h-7 items-center justify-center rounded-full bg-muted px-4 text-center text-sm font-medium text-primary transition-colors hover:text-primary'
href={`/examples/${item.id}`}
href={`/examples/${item.id}/`}
>
{item.name}
</a>
Expand All @@ -65,7 +65,7 @@ const pathname = Astro.url.pathname
return (
<a
class='flex h-7 items-center justify-center rounded-full px-4 text-center text-sm text-muted-foreground transition-colors hover:text-primary'
href={`/examples/${item.id}`}
href={`/examples/${item.id}/`}
>
{item.name}
</a>
Expand All @@ -86,7 +86,7 @@ const pathname = Astro.url.pathname
>
<div class='group absolute hidden h-full w-full md:block'>
<div
class='bg-black absolute left-[20px] top-[20px] flex items-center gap-x-2 rounded-md p-3 text-white opacity-0 shadow-md transition-opacity group-hover:opacity-100'
class='absolute left-[20px] top-[20px] flex items-center gap-x-2 rounded-md bg-black p-3 text-white opacity-0 shadow-md transition-opacity group-hover:opacity-100'
>
<svg
xmlns='http://www.w3.org/2000/svg'
Expand Down

0 comments on commit d67c6b8

Please sign in to comment.