Make Blog Tags case insensitive
This commit is contained in:
@ -4,7 +4,7 @@ title: 'Markdown elements demo post'
|
||||
description: 'Lorem ipsum dolor sit amet'
|
||||
excerpt: 'Sint sit cillum pariatur eiusmod nulla pariatur ipsum. Sit laborum anim qui mollit tempor pariatur nisi minim dolor. Aliquip et adipisicing sit sit fugiat'
|
||||
image: '~/assets/images/astronaut.jpg'
|
||||
tags: [markdown, astro, blog]
|
||||
tags: [markdown, blog, Astro]
|
||||
---
|
||||
|
||||
import Logo from '~/components/atoms/Logo.astro';
|
||||
|
@ -8,7 +8,7 @@ const { tags, class: className = 'text-sm' } = Astro.props;
|
||||
tags && Array.isArray(tags) && (
|
||||
<ul class={className}>
|
||||
{tags.map((tag) => (
|
||||
<li class="bg-gray-100 dark:bg-slate-700 inline-block mr-2 mb-2 py-0.5 px-2">
|
||||
<li class="bg-gray-100 dark:bg-slate-700 inline-block mr-2 mb-2 py-0.5 px-2 lowercase">
|
||||
<a href={getPermalink(tag, 'tag')}>{tag}</a>
|
||||
</li>
|
||||
))}
|
||||
|
@ -20,7 +20,7 @@ export async function getStaticPaths({ paginate }) {
|
||||
|
||||
return Array.from(tags).map((tag) =>
|
||||
paginate(
|
||||
posts.filter((post) => Array.isArray(post.tags) && post.tags.includes(tag)),
|
||||
posts.filter((post) => Array.isArray(post.tags) && post.tags.find((elem) => elem.toLowerCase() === tag)),
|
||||
{
|
||||
params: { tag: cleanSlug(tag), tags: TAG_BASE || undefined },
|
||||
pageSize: BLOG.postsPerPage,
|
||||
|
Reference in New Issue
Block a user