Skip to content

Commit

Permalink
fix tags page and menu
Browse files Browse the repository at this point in the history
  • Loading branch information
vanessacor committed May 11, 2024
1 parent 2ee9479 commit 88c6313
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/navigation/Navigation.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { pathname } = Astro.url;
const currentUrl = pathname.replace(/\/$/, '')
const isTagsActive = currentUrl === "tags"
const isTagsActive = currentUrl === "tags" || currentUrl.startsWith("/tags")
const navigationItems = [
{ label: "Home", href: "/" },
Expand Down
5 changes: 3 additions & 2 deletions src/components/navigation/TagsMenu.astro
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ const tagsElement = tags.map((tag) => ({ label: tag, url: `/tags/${tag}` }));
<style scoped>
#tags-modal {
display: none;
position: absolute;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: var(--background-color);
z-index: 100;
padding: var(--space-medium) var(--space-small);
background-color: var(--background-color);
}

.modal {
Expand Down
10 changes: 8 additions & 2 deletions src/pages/tags/[tag].astro
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const filteredPosts = posts.filter((post) => post.data.tags.includes(tag) );
---
<BlogLayout pageTitle={tag}>
<div>
<h2>Posts tagged with #{tag}</h2>
<h2>#{tag}</h2>
{
filteredPosts
.sort(
Expand All @@ -40,4 +40,10 @@ const filteredPosts = posts.filter((post) => post.data.tags.includes(tag) );
})
}
</div>
</BlogLayout>
</BlogLayout>

<style scoped>
h2 {
margin-bottom: var(--space-large);
}
</style>

0 comments on commit 88c6313

Please sign in to comment.