You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by sh...@apache.org on 2024/02/29 06:03:09 UTC

(incubator-answer-website) branch main updated: Social img (#155)

This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-answer-website.git


The following commit(s) were added to refs/heads/main by this push:
     new 9c3fd13d Social img (#155)
9c3fd13d is described below

commit 9c3fd13d283630fbe705fd3a1753ee4cdf8cdf20
Author: dashuai <li...@sifou.com>
AuthorDate: Thu Feb 29 14:03:02 2024 +0800

    Social img (#155)
---
 i18n/zh-CN/code.json                                   | 9 +++++++++
 i18n/zh-CN/docusaurus-plugin-content-docs/current.json | 4 ++--
 src/theme/DocSidebarItem/Category/index.tsx            | 9 ++++++++-
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/i18n/zh-CN/code.json b/i18n/zh-CN/code.json
index 1f284a4e..78cd85cf 100644
--- a/i18n/zh-CN/code.json
+++ b/i18n/zh-CN/code.json
@@ -574,5 +574,14 @@
   },
   "plugins.instruction.join": {
     "message": "加入我们的社区"
+  },
+  "docs.sidebar.tutorialSidebar.category.Getting Started": {
+    "message": "入门"
+  },
+  "docs.sidebar.tutorialSidebar.category.User Guides": {
+    "message": "用户指南"
+  },
+  "docs.sidebar.tutorialSidebar.category.Developer Guides": {
+    "message": "开发者指南"
   }
 }
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current.json b/i18n/zh-CN/docusaurus-plugin-content-docs/current.json
index c286665b..afc78e1f 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current.json
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current.json
@@ -23,9 +23,9 @@
     "message": "贡献",
     "description": "The label for category Contributing in sidebar tutorialSidebar"
   },
-  "sidebar.tutorialSidebar.link.Getting Started": {
+  "sidebar.tutorialSidebar.category.Getting Started": {
     "message": "入门",
-    "description": "The label for link Getting Started in sidebar tutorialSidebar, linking to #"
+    "description": "The label for category Contents Management in sidebar tutorialSidebar"
   },
   "sidebar.tutorialSidebar.link.Recipes": {
     "message": "教程",
diff --git a/src/theme/DocSidebarItem/Category/index.tsx b/src/theme/DocSidebarItem/Category/index.tsx
index 8890a804..da633810 100644
--- a/src/theme/DocSidebarItem/Category/index.tsx
+++ b/src/theme/DocSidebarItem/Category/index.tsx
@@ -80,6 +80,7 @@ function CollapseButton({
   categoryLabel: string;
   onClick: ComponentProps<'button'>['onClick'];
 }) {
+  console.log('categoryLabel', categoryLabel);
   return (
     <button
       aria-label={
@@ -156,6 +157,8 @@ export default function DocSidebarItemCategory({
     }
   }, [collapsible, expandedItem, index, setCollapsed, autoCollapseCategories]);
 
+  console.log('collapsed', item);
+
   return (
     <li
       className={clsx(
@@ -196,7 +199,11 @@ export default function DocSidebarItemCategory({
           aria-expanded={collapsible ? !collapsed : undefined}
           href={collapsible ? hrefWithSSRFallback ?? '#' : hrefWithSSRFallback}
           {...props}>
-          {label}
+          {translate({
+                id: `docs.sidebar.tutorialSidebar.category.${label}`,
+                message: label,
+              },
+              {label: label},)}
         </Link>
         {href && collapsible && (
           <CollapseButton