Fix #397: Adjust URL for Chinese Categories and Tags
This commit is contained in:
@@ -64,8 +64,8 @@ const link = APP_BLOG?.post?.isEnabled ? getPermalink(post.permalink, 'post') :
|
||||
<>
|
||||
{' '}
|
||||
·{' '}
|
||||
<a class="capitalize hover:underline" href={getPermalink(post.category, 'category')}>
|
||||
{post.category.replaceAll('-', ' ')}
|
||||
<a class="hover:underline" href={getPermalink(post.category.slug, 'category')}>
|
||||
{post.category.title}
|
||||
</a>
|
||||
</>
|
||||
)
|
||||
@@ -87,8 +87,14 @@ const link = APP_BLOG?.post?.isEnabled ? getPermalink(post.permalink, 'post') :
|
||||
</header>
|
||||
|
||||
{post.excerpt && <p class="flex-grow text-muted dark:text-slate-400 text-lg">{post.excerpt}</p>}
|
||||
<footer class="mt-5">
|
||||
<PostTags tags={post.tags} />
|
||||
</footer>
|
||||
{
|
||||
post.tags && Array.isArray(post.tags) ? (
|
||||
<footer class="mt-5">
|
||||
<PostTags tags={post.tags} />
|
||||
</footer>
|
||||
) : (
|
||||
<Fragment />
|
||||
)
|
||||
}
|
||||
</div>
|
||||
</article>
|
||||
|
@@ -40,8 +40,8 @@ const { Content } = post;
|
||||
<>
|
||||
{' '}
|
||||
·{' '}
|
||||
<a class="capitalize hover:underline inline-block" href={getPermalink(post.category, 'category')}>
|
||||
{post.category.replaceAll('-', ' ')}
|
||||
<a class="hover:underline inline-block" href={getPermalink(post.category.slug, 'category')}>
|
||||
{post.category.title}
|
||||
</a>
|
||||
</>
|
||||
)
|
||||
|
@@ -24,13 +24,13 @@ const { tags, class: className = 'text-sm', title = undefined, isCategory = fals
|
||||
{tags.map((tag) => (
|
||||
<li class="bg-gray-100 dark:bg-slate-700 inline-block mr-2 rtl:mr-0 rtl:ml-2 mb-2 py-0.5 px-2 lowercase font-medium">
|
||||
{!APP_BLOG?.tag?.isEnabled ? (
|
||||
tag
|
||||
tag.title
|
||||
) : (
|
||||
<a
|
||||
href={getPermalink(tag, (isCategory ? 'category' : 'tag'))}
|
||||
href={getPermalink(tag.slug, (isCategory ? 'category' : 'tag'))}
|
||||
class="text-muted dark:text-slate-300 hover:text-primary dark:hover:text-gray-200"
|
||||
>
|
||||
{tag}
|
||||
{tag.title}
|
||||
</a>
|
||||
)}
|
||||
</li>
|
||||
|
Reference in New Issue
Block a user