Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Social img #155

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ const config = {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
image: 'img/head-icon.png',
}),

stylesheets: [
'/fonts/fonts.css',
],
Expand Down
9 changes: 9 additions & 0 deletions i18n/zh-CN/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "开发者指南"
}
}
4 changes: 2 additions & 2 deletions i18n/zh-CN/docusaurus-plugin-content-docs/current.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "教程",
Expand Down
9 changes: 8 additions & 1 deletion src/theme/DocSidebarItem/Category/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ function CollapseButton({
categoryLabel: string;
onClick: ComponentProps<'button'>['onClick'];
}) {
console.log('categoryLabel', categoryLabel);
return (
<button
aria-label={
Expand Down Expand Up @@ -156,6 +157,8 @@ export default function DocSidebarItemCategory({
}
}, [collapsible, expandedItem, index, setCollapsed, autoCollapseCategories]);

console.log('collapsed', item);

return (
<li
className={clsx(
Expand Down Expand Up @@ -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
Expand Down
Loading