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

zfc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 7c000eefd Remove year display for blog sidebar (#30)
7c000eefd is described below

commit 7c000eefdfdb75feeb065381d4faee3545489a86
Author: Glass Panel <[email protected]>
AuthorDate: Mon Jul 21 10:48:34 2025 +0800

    Remove year display for blog sidebar (#30)
    
    * Remove year display for blog sidebar
---
 site/src/css/custom.css                     | 10 ---------
 site/src/theme/BlogSidebar/Content/index.js | 33 +++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/site/src/css/custom.css b/site/src/css/custom.css
index 4a83e5403..2bc6a4cfd 100644
--- a/site/src/css/custom.css
+++ b/site/src/css/custom.css
@@ -28,13 +28,3 @@
   --ifm-color-primary-lightest: #4fddbf;
   --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
 }
-
-/* Hide year headings in blog sidebar - targeting the specific class */
-.yearGroupHeading_ndGK {
-  display: none !important;
-}
-
-/* Alternative: Hide year headings in blog sidebar using general selector */
-.blog-sidebar h3 {
-  display: none !important;
-}
diff --git a/site/src/theme/BlogSidebar/Content/index.js 
b/site/src/theme/BlogSidebar/Content/index.js
new file mode 100644
index 000000000..b0aa17b79
--- /dev/null
+++ b/site/src/theme/BlogSidebar/Content/index.js
@@ -0,0 +1,33 @@
+import React, {memo} from 'react';
+import {useThemeConfig} from '@docusaurus/theme-common';
+import {groupBlogSidebarItemsByYear} from 
'@docusaurus/plugin-content-blog/client';
+import Heading from '@theme/Heading';
+function BlogSidebarYearGroup({year, yearGroupHeadingClassName, children}) {
+  return (
+    <div role="group">
+      
+      {children}
+    </div>
+  );
+}
+function BlogSidebarContent({items, yearGroupHeadingClassName, ListComponent}) 
{
+  const themeConfig = useThemeConfig();
+  if (themeConfig.blog.sidebar.groupByYear) {
+    const itemsByYear = groupBlogSidebarItemsByYear(items);
+    return (
+      <>
+        {itemsByYear.map(([year, yearItems]) => (
+          <BlogSidebarYearGroup
+            key={year}
+            year={year}
+            yearGroupHeadingClassName={yearGroupHeadingClassName}>
+            <ListComponent items={yearItems} />
+          </BlogSidebarYearGroup>
+        ))}
+      </>
+    );
+  } else {
+    return <ListComponent items={items} />;
+  }
+}
+export default memo(BlogSidebarContent);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to