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

lhotari pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git


The following commit(s) were added to refs/heads/main by this push:
     new 3b71b495c04 Add BlogPostPageHidden comment to hide content that is 
visible in the listing page (summary)
3b71b495c04 is described below

commit 3b71b495c042e10f56f7863f69f4f5eb47175693
Author: Lari Hotari <[email protected]>
AuthorDate: Tue Sep 9 18:44:40 2025 +0300

    Add BlogPostPageHidden comment to hide content that is visible in the 
listing page (summary)
    
    This allows hiding the blog post summary before "<!--truncate-->".
    The blog post must have .mdx suffix.
    
    example usage:
    ---
    author: Name
    title: "Blog title"
    date: YYYY-MM-dd
    ---
    
    import BlogPostPageHidden from 
'@site/src/components/ui/BlogPostPageHidden/BlogPostPageHidden'
    
    <BlogPostPageHidden>
    This should only be visible on the blog post listing page
    </BlogPostPageHidden>
    <!--truncate-->
    Actual blog content
---
 src/components/ui/BlogPostPageHidden/BlogPostPageHidden.tsx | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/components/ui/BlogPostPageHidden/BlogPostPageHidden.tsx 
b/src/components/ui/BlogPostPageHidden/BlogPostPageHidden.tsx
new file mode 100644
index 00000000000..604af8560af
--- /dev/null
+++ b/src/components/ui/BlogPostPageHidden/BlogPostPageHidden.tsx
@@ -0,0 +1,12 @@
+import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
+
+export default function BlogPostPageHidden({children}) {
+  const {isBlogPostPage} = useBlogPost();
+  
+  // Only hide on blog post pages
+  if (isBlogPostPage) {
+    return null;
+  }
+  
+  return <>{children}</>;
+}
\ No newline at end of file

Reply via email to