This is an automated email from the ASF dual-hosted git repository.
xushiyan pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/asf-site by this push:
new f98eae4346fc chore(site): style for Ask Ai Deep thinking option and
blog date discrepancy (#17620)
f98eae4346fc is described below
commit f98eae4346fcd59be140ef5f76dee7e6079908d9
Author: pintusoliya <[email protected]>
AuthorDate: Thu Dec 18 01:42:14 2025 +0530
chore(site): style for Ask Ai Deep thinking option and blog date
discrepancy (#17620)
---
website/docusaurus.config.js | 6 +++---
website/src/components/BlogList/index.js | 33 +++++++++++++++++---------------
2 files changed, 21 insertions(+), 18 deletions(-)
diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js
index abce898dd34c..f9567fc7a7cc 100644
--- a/website/docusaurus.config.js
+++ b/website/docusaurus.config.js
@@ -554,7 +554,7 @@ module.exports = {
"data-project-name": "Apache Hudi",
"data-project-color": "#FFFFFF",
"data-project-logo": "/assets/images/logo-big.png",
- "data-modal-disclaimer": "This AI assistant answers Apache Hudi
questions using your
[documentation](https://hudi.apache.org/docs/quick-start-guide/), [dev
setup](https://hudi.apache.org/contribute/developer-setup/), the [tech
specs](https://hudi.apache.org/tech-specs-1point0/) and [open GitHub
Issues](https://github.com/apache/hudi/issues/`) from the last year.",
+ "data-modal-disclaimer": "This AI assistant answers Apache Hudi
questions using your
[documentation](https://hudi.apache.org/docs/quick-start-guide/), [dev
setup](https://hudi.apache.org/contribute/developer-setup/), the [tech
specs](https://hudi.apache.org/tech-specs-1point0/) and [open GitHub
Issues](https://github.com/apache/hudi/issues/) from the last year.",
"data-modal-title": "Apache Hudi AI Assistant",
"data-modal-example-questions-title": "Try asking me...",
"data-modal-example-questions": "How can I convert an existing COW table
to MOR?,How do I set up incremental queries with Hudi tables?",
@@ -592,9 +592,9 @@ module.exports = {
"data-modal-disclaimer-text-color": "#15467D",
"data-deep-thinking-button-bg-color": "#228EDE",
"data-deep-thinking-button-text-color": "#FFFFFF",
- "data-deep-thinking-button-active-bg-color": "#0478C0",
+ "data-deep-thinking-button-active-bg-color": "#205792",
"data-deep-thinking-button-hover-bg-color": "#0478C0",
- "data-deep-thinking-button-active-hover-bg-color": "#0478C0",
+ "data-deep-thinking-button-active-hover-bg-color": "#205792",
"data-deep-thinking-button-active-text-color": "#FFFFFF",
async: true,
}
diff --git a/website/src/components/BlogList/index.js
b/website/src/components/BlogList/index.js
index e91e96c86da5..0cbd219f7832 100644
--- a/website/src/components/BlogList/index.js
+++ b/website/src/components/BlogList/index.js
@@ -1,3 +1,4 @@
+import {useDateTimeFormat} from "@docusaurus/theme-common/internal";
import React, { useState } from 'react';
import Link from '@docusaurus/Link';
import { useBaseUrlUtils } from
'@docusaurus/core/lib/client/exports/useBaseUrl';
@@ -42,7 +43,7 @@ const POSTS_PER_PAGE = 12;
export default function BlogList() {
const { withBaseUrl } = useBaseUrlUtils();
const [currentPage, setCurrentPage] = useState(1);
-
+
const totalPages = Math.ceil(sortedBlogPosts.length / POSTS_PER_PAGE);
const startIndex = (currentPage - 1) * POSTS_PER_PAGE;
const endIndex = startIndex + POSTS_PER_PAGE;
@@ -58,11 +59,11 @@ export default function BlogList() {
const maxVisible = 5;
let startPage = Math.max(1, currentPage - Math.floor(maxVisible / 2));
let endPage = Math.min(totalPages, startPage + maxVisible - 1);
-
+
if (endPage - startPage < maxVisible - 1) {
startPage = Math.max(1, endPage - maxVisible + 1);
}
-
+
for (let i = startPage; i <= endPage; i++) {
pages.push(i);
}
@@ -77,17 +78,19 @@ export default function BlogList() {
const { frontMatter, assets, metadata } = blog;
const { date, title, authors, permalink, description } = metadata ||
{};
const image = assets?.image ?? frontMatter?.image ??
"/assets/images/hudi.png";
-
+
if (!title || !permalink) {
return null;
}
-
- const dateObj = date ? new Date(date) : null;
- const formattedDate = dateObj ? dateObj.toLocaleDateString('en-US',
{
- year: 'numeric',
- month: 'long',
- day: 'numeric'
- }) : '';
+
+ const dateTimeFormat = useDateTimeFormat({
+ day: 'numeric',
+ month: 'long',
+ year: 'numeric',
+ timeZone: 'UTC',
+ });
+ const formatDate = (blogDate) => dateTimeFormat.format(new
Date(blogDate));
+ const formattedDate = date ? formatDate(date) : '';
return (
<article key={index} className={styles.card}>
@@ -115,7 +118,7 @@ export default function BlogList() {
);
})}
</div>
-
+
{totalPages > 1 && (
<nav className={styles.pagination} aria-label="Blog pagination">
<button
@@ -126,7 +129,7 @@ export default function BlogList() {
>
Previous
</button>
-
+
<div className={styles.paginationNumbers}>
{getPageNumbers().map((pageNum) => (
<button
@@ -140,7 +143,7 @@ export default function BlogList() {
</button>
))}
</div>
-
+
<button
className={styles.paginationButton}
onClick={() => handlePageChange(currentPage + 1)}
@@ -151,7 +154,7 @@ export default function BlogList() {
</button>
</nav>
)}
-
+
<div className={styles.paginationInfo}>
Showing {startIndex + 1}-{Math.min(endIndex, sortedBlogPosts.length)}
of {sortedBlogPosts.length} posts
</div>