🎨 [enhancement] Added optional title functionality to Tags.astro
This commit is contained in:
@ -7,28 +7,34 @@ import type { Post } from '~/types';
|
|||||||
export interface Props {
|
export interface Props {
|
||||||
tags: Post['tags'];
|
tags: Post['tags'];
|
||||||
class?: string;
|
class?: string;
|
||||||
|
title?: string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { tags, class: className = 'text-sm' } = Astro.props;
|
const { tags, class: className = 'text-sm', title = undefined } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
{
|
{
|
||||||
tags && Array.isArray(tags) && (
|
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 lowercase font-medium">
|
{header !== undefined && <span class="align-super font-normal underline underline-offset-4 decoration-2 dark:text-slate-400">{header}</span>}
|
||||||
{BLOG?.tag?.disabled ? (
|
</>
|
||||||
tag
|
<ul class={className}>
|
||||||
) : (
|
{tags.map((tag) => (
|
||||||
<a
|
<li class="bg-gray-100 dark:bg-slate-700 inline-block mr-2 mb-2 py-0.5 px-2 lowercase font-medium">
|
||||||
href={getPermalink(tag, 'tag')}
|
{BLOG?.tag?.disabled || PORTFOLIO?.tag?.disabled ? (
|
||||||
class="text-muted dark:text-slate-300 hover:text-primary dark:hover:text-gray-200"
|
tag
|
||||||
>
|
) : (
|
||||||
{tag}
|
<a
|
||||||
</a>
|
href={getPermalink(tag, 'tag')}
|
||||||
)}
|
class="text-muted dark:text-slate-300 hover:text-primary dark:hover:text-gray-200"
|
||||||
</li>
|
>
|
||||||
))}
|
{tag}
|
||||||
</ul>
|
</a>
|
||||||
|
)}
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user