Skip to content

Commit

Permalink
feat: make tags in article's card be clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
GabsEdits committed Aug 29, 2024
1 parent a81b05f commit 1ce10f9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions custom/ArticleList.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
}
}

.tags span {
cursor: pointer;
}

&.archive {
background-color: #ff00dd11;

Expand Down Expand Up @@ -85,6 +89,7 @@

.tags span {
background-color: #5b4f001d;
cursor: pointer;

@media (prefers-color-scheme: dark) {
background-color: #ffff0037;
Expand Down
12 changes: 8 additions & 4 deletions docs/.vitepress/theme/ArticleList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@
</span>
</p>
<div class="tags" v-if="post.tags">
<span v-if="typeof post.tags === 'string'" :key="post.tags">{{
post.tags
}}</span>
<span v-else v-for="tag in post.tags" :key="tag">{{ tag }}</span>
<span
v-if="typeof post.tags === 'string'"
:key="post.tags"
@click="filterPosts(post.tags)"
>{{ post.tags }}</span
>
<span v-else v-for="tag in post.tags" :key="tag" @click="filterPosts(tag)"
>{{ tag }}</span>
</div>
</div>
</article>
Expand Down

0 comments on commit 1ce10f9

Please sign in to comment.