diff --git a/cspell.config.yaml b/cspell.config.yaml index ad68f6e4c..cb74a1e05 100644 --- a/cspell.config.yaml +++ b/cspell.config.yaml @@ -62,11 +62,13 @@ words: - defu - demi - demodel + - devlog - devlogs - directml - dokidoki - dotenvx - DownloadLive2DSDK + - dreamlog - dtolnay - dtype - dtypes diff --git a/docs/.vitepress/components/BlogPosts.vue b/docs/.vitepress/components/BlogPosts.vue index 1a78581fe..56f5ef39e 100644 --- a/docs/.vitepress/components/BlogPosts.vue +++ b/docs/.vitepress/components/BlogPosts.vue @@ -5,6 +5,7 @@ import { computedAsync } from '@vueuse/core' import { subtle } from 'uncrypto' import { useData } from 'vitepress' import { computed, ref } from 'vue' +import { useI18n } from 'vue-i18n' interface Post { title: string @@ -24,17 +25,19 @@ const props = defineProps<{ data: Post[] }>() +const { t } = useI18n() const { isDark } = useData() -const category = ref('All') +const category = ref('all') const categories = computed(() => { - const allCategories = props.data.map(post => post.frontmatter?.category).filter(Boolean) - return ['All', ...new Set(allCategories as string[])] + const allCategories = props.data.map(post => post.frontmatter?.category).filter(Boolean).map(post => post?.toLowerCase()) + return ['all', ...new Set(allCategories as string[])] }) const posts = computed(() => { - if (category.value && category.value !== 'All') { - return props.data.filter(post => post.frontmatter?.category === category.value).filter(post => !!(post.frontmatter as any)?.title) + if (category.value && category.value !== 'all') { + return props.data.filter(post => post.frontmatter?.category?.toLowerCase() === category.value).filter(post => !!(post.frontmatter as any)?.title) } + return (props.data as Post[]).filter(post => !!(post.frontmatter as any)?.title) }) @@ -131,6 +134,7 @@ ${patternElements} const svgArts = computedAsync(async () => { return Promise.all(posts.value.map(async (post) => { const generator = await createTileGenerator(post.title) + return { light: generator.generate({ dark: false }), dark: generator.generate({ dark: true }), @@ -143,29 +147,29 @@ const svgArts = computedAsync(async () => {
- Follow our journey and get the latest updates from the development team. + {{ t('docs.theme.blog.subtitle') }}
- No posts found in this category. + {{ t('docs.theme.blog.no-posts') }}