Skip to content

[docs] feature: refactor blog layout ui to card grid#4182

Open
iamSerafinnn wants to merge 8 commits into
apache:masterfrom
iamSerafinnn:refactor-blog-ui
Open

[docs] feature: refactor blog layout ui to card grid#4182
iamSerafinnn wants to merge 8 commits into
apache:masterfrom
iamSerafinnn:refactor-blog-ui

Conversation

@iamSerafinnn

Copy link
Copy Markdown

What's changed?

I refactored your HertzeBeat site's UI for its home website blog to a more modern layout of card-based grids. It is built from your defaults Docusaurus list-style design and design is inspired from the site you reference, answer.apache.org/blog/.

Checklist

  • [✅] I have read the Contributing Guide
  • [✅] I have written the necessary doc or comment.
  • [❌ ] I have added the necessary unit tests and all cases have passed.

Add or update API

  • [❌ ] I have added the necessary e2e tests and all cases have passed.

@github-actions github-actions Bot added doc Improvements or additions to documentation home labels Jun 28, 2026
@tomsun28

tomsun28 commented Jul 8, 2026

Copy link
Copy Markdown
Member

hi thanks, seem has some error when i start at local.

    "@docusaurus/plugin-content-blog": "^3.10.1",

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the Docusaurus blog list UI (home site) from the default vertical list into a card-based grid by introducing a @theme/BlogPostItems override and corresponding CSS, along with a Docusaurus dependency version bump.

Changes:

  • Added a custom home/src/theme/BlogPostItems implementation to render blog post items as cards in a grid.
  • Introduced new CSS for grid/card styling and responsive breakpoints.
  • Updated Docusaurus dependency versions in home/package.json (and adjusted the semver range style).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
home/src/theme/BlogPostItems/styles.css Adds grid + card styling and responsive layout for blog listing.
home/src/theme/BlogPostItems/index.js Overrides the default BlogPostItems renderer to output card-based items using blog metadata.
home/src/pages/styles.module.css Minor whitespace cleanup.
home/src/pages/index.js Adds additional inline comments and retains auto-redirect logic.
home/package.json Bumps Docusaurus dependencies and changes them to caret (^) ranges.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// Docusaurus Hook giving you access to the current post's metadata
// formats it for BlogCard rendering
const {metadata} = useBlogPost();
const {permalink, title, date, authors, description, tags} = metadata;
Comment on lines +65 to +67
{authors.length > 0 && (
<span className="blog-card__author">· {authors[0].name}</span>
)}
Comment on lines +31 to +33
// _________________________________________________________________
// REFACTORED BLOG SITE - Serafin O. Gargantiel III.
// _________________________________________________________________
Comment on lines +6 to +28
// import BlogPostItem from '@theme/BlogPostItem';
// This is the default component that renders blog posts one by
// one in a vertical list
//_________________________________________________________________
// export default function BlogPostItems({
// items,
// component: BlogPostItemComponent = BlogPostItem,
// }) {
// return (
// <>
// {items.map(({content: BlogPostContent}) => (
// <BlogPostProvider
// key={BlogPostContent.metadata.permalink}
// content={BlogPostContent}>
// <BlogPostItemComponent>
// <BlogPostContent />
// </BlogPostItemComponent>
// </BlogPostProvider>
// ))}
// </>
// );
// }
//_________________________________________________________________
day: 'numeric',
});

// Rending a BlogCard
Comment thread home/src/pages/index.js
return (
<>
{/* Injects SEO metadata into the page head */}
{/* Search Engine Optization */}
Comment thread home/src/pages/index.js
function autoRedirect() {

// User Language
let lang = global.navigator?.language || navigator?.userLanguage
Comment thread home/src/pages/index.js
let lang = global.navigator?.language || navigator?.userLanguage

// If language is chinese, redirect to "/zh-cn" version of the site
if (lang != null && (lang.toLowerCase() === 'zh-cn' || lang.toLowerCase().indexOf('zh') > 0)) {
Comment thread home/src/pages/index.js

// If language is chinese, redirect to "/zh-cn" version of the site
if (lang != null && (lang.toLowerCase() === 'zh-cn' || lang.toLowerCase().indexOf('zh') > 0)) {
console.log(window.location.pathname);
Comment thread home/package.json
Comment on lines +22 to +29
"@docusaurus/core": "^3.10.1",
"@docusaurus/plugin-client-redirects": "^3.10.1",
"@docusaurus/plugin-pwa": "^3.10.1",
"@docusaurus/plugin-sitemap": "^3.10.1",
"@docusaurus/preset-classic": "^3.10.1",
"@docusaurus/remark-plugin-npm2yarn": "^3.10.1",
"@docusaurus/theme-live-codeblock": "^3.10.1",
"@docusaurus/theme-search-algolia": "^3.10.1",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Improvements or additions to documentation home

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants