mirror of https://github.com/YunYouJun/valaxy
fix: categories i18n display
This commit is contained in:
parent
00ed99b171
commit
d7dc38d0b3
|
@ -5,7 +5,7 @@ excerpt:
|
|||
ai: AI-Generated Excerpt
|
||||
|
||||
siteConfig:
|
||||
title: Site Config Title
|
||||
title: Custom Blog Name
|
||||
subtitle: Next Generation Static Blog Framework.
|
||||
description: Valaxy Theme Yun Preview
|
||||
author:
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
---
|
||||
title: Code Block Test
|
||||
title:
|
||||
en: Code Block Test
|
||||
zh-CN: 代码块测试
|
||||
categories:
|
||||
- $locale:category.test
|
||||
---
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
---
|
||||
title: 赞助者
|
||||
title:
|
||||
en: Sponsors
|
||||
zh-CN: 赞助者
|
||||
---
|
||||
|
||||
## [Sponsors](https://www.yunyoujun.cn/sponsors/)
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
<script lang="ts" setup>
|
||||
import type { Post } from 'valaxy'
|
||||
import { useValaxyI18n } from 'valaxy'
|
||||
|
||||
defineProps<{
|
||||
categories: Post['categories']
|
||||
}>()
|
||||
|
||||
const { $t } = useValaxyI18n()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -19,7 +22,7 @@ defineProps<{
|
|||
>
|
||||
<div m="x-1" inline-flex i-ri-folder-2-line />
|
||||
<span>
|
||||
{{ Array.isArray(categories) ? categories.join(' / ') : categories }}
|
||||
{{ Array.isArray(categories) ? categories.map($t).join(' / ') : $t(categories || '') }}
|
||||
</span>
|
||||
</RouterLink>
|
||||
</template>
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
<script lang="ts" setup>
|
||||
import type { Post } from 'valaxy'
|
||||
import { useValaxyI18n } from 'valaxy'
|
||||
|
||||
defineProps<{
|
||||
tags: Post['tags']
|
||||
}>()
|
||||
|
||||
const { $t } = useValaxyI18n()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -19,7 +22,7 @@ defineProps<{
|
|||
border
|
||||
hover="bg-blue-500 text-white"
|
||||
>
|
||||
<span>{{ tag }}</span>
|
||||
<span>{{ $t(tag) }}</span>
|
||||
</RouterLink>
|
||||
</div>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue