This is an automated email from the ASF dual-hosted git repository.
400Ping pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/mahout.git
The following commit(s) were added to refs/heads/main by this push:
new 0474f57ef [Website] Split blog post pagination by content type (#1425)
0474f57ef is described below
commit 0474f57ef274af3bc4b94c5ecaa9c2dede658c3c
Author: Jie-Kai Chang <[email protected]>
AuthorDate: Mon Jun 29 13:11:15 2026 +0800
[Website] Split blog post pagination by content type (#1425)
Signed-off-by: 400Ping <[email protected]>
---
website/src/theme/BlogPostPage/index.tsx | 33 +++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
diff --git a/website/src/theme/BlogPostPage/index.tsx
b/website/src/theme/BlogPostPage/index.tsx
index 28e1110ae..19863f349 100644
--- a/website/src/theme/BlogPostPage/index.tsx
+++ b/website/src/theme/BlogPostPage/index.tsx
@@ -13,16 +13,47 @@ import BlogPostPageStructuredData from
'@theme/BlogPostPage/StructuredData';
import TOC from '@theme/TOC';
import ContentVisibility from '@theme/ContentVisibility';
import type {Props} from '@theme/BlogPostPage';
+import blogPostList from '~blog/default/blog-post-list-prop-default.json';
import styles from './styles.module.css';
+type BlogListEntry = (typeof blogPostList.items)[number];
+
+function isMeetingMinutes(item: Pick<BlogListEntry, 'permalink' | 'title'>) {
+ return (
+ item.title.toLowerCase().includes('meeting minutes') ||
+ item.permalink.toLowerCase().includes('meeting-minutes')
+ );
+}
+
+function getSiblingPosts({
+ permalink,
+ title,
+}: Pick<BlogListEntry, 'permalink' | 'title'>) {
+ const currentIsMinutes = isMeetingMinutes({permalink, title});
+ const peers = blogPostList.items.filter(
+ (item) => isMeetingMinutes(item) === currentIsMinutes,
+ );
+ const currentIndex = peers.findIndex((item) => item.permalink === permalink);
+
+ if (currentIndex === -1) {
+ return {nextItem: undefined, prevItem: undefined};
+ }
+
+ return {
+ prevItem: peers[currentIndex - 1],
+ nextItem: peers[currentIndex + 1],
+ };
+}
+
function BlogPostPageContent({
children,
}: {
children: ReactNode;
}): ReactNode {
const {metadata, toc} = useBlogPost();
- const {nextItem, prevItem, frontMatter} = metadata;
+ const {frontMatter, permalink, title} = metadata;
+ const {nextItem, prevItem} = getSiblingPosts({permalink, title});
const {
hide_table_of_contents: hideTableOfContents,
toc_min_heading_level: tocMinHeadingLevel,