From a69b9ccc8f0f556f568f42e2613842a56d7eaf0d Mon Sep 17 00:00:00 2001 From: shuai Date: Mon, 13 Jan 2025 14:26:35 +0800 Subject: [PATCH] feat: default matches browser language #285 --- plugins/blog-plugin.js | 3 - .../blog/BlogCategoryPostsPage/index.tsx | 1 - src/components/blog/BlogDetailPage/index.tsx | 1 - src/components/blog/BlogHome/index.tsx | 1 - src/theme/DocSidebarItem/Category/index.tsx | 3 - src/theme/Layout/BrowserLanguage.tsx | 57 +++++++++++++++++++ src/theme/Layout/index.tsx | 3 +- src/theme/NavbarItem/NavbarNavLink.tsx | 8 +++ 8 files changed, 67 insertions(+), 10 deletions(-) create mode 100644 src/theme/Layout/BrowserLanguage.tsx diff --git a/plugins/blog-plugin.js b/plugins/blog-plugin.js index fcd05dd90b..59689bc830 100644 --- a/plugins/blog-plugin.js +++ b/plugins/blog-plugin.js @@ -149,8 +149,6 @@ async function blogPluginExtended(...pluginArgs) { const { createData, addRoute } = actions; - // console.log('blogPosts', blogPosts[0]); - const removeDraftPosts = allBlogPosts.filter((post) => !post.metadata.frontMatter?.draft); // Fecommend posts list @@ -264,7 +262,6 @@ async function blogPluginExtended(...pluginArgs) { permalink: generateCategoryPath(category.label), }; - // console.log('categoryProp', categoryProp); const categoryPropPath = await createData( `${utils.docuHash(categoryProp.label)}.json`, JSON.stringify(categoryProp, null, 2), diff --git a/src/components/blog/BlogCategoryPostsPage/index.tsx b/src/components/blog/BlogCategoryPostsPage/index.tsx index 0c312f3515..3b8ab793cd 100644 --- a/src/components/blog/BlogCategoryPostsPage/index.tsx +++ b/src/components/blog/BlogCategoryPostsPage/index.tsx @@ -21,7 +21,6 @@ interface IProps extends Props { } const Index = (props: IProps) => { const { category, categoriyList, items, listMetadata, } = props - // console.log('...props', props); return ( ['onClick']; }) { - // console.log('categoryLabel', categoryLabel); return (