Skip to content

Show all blog posts on single page - #1731

Merged
Andriy Knysh (aknysh) merged 4 commits into
mainfrom
show-all-blog-posts
Oct 31, 2025
Merged

Andriy Knysh (aknysh) merged 4 commits into
mainfrom
show-all-blog-posts

Conversation

@osterman

@osterman Erik Osterman (Cloud Posse) (osterman) commented Oct 30, 2025 •

Copy link
Copy Markdown
Member

Summary

Changed the blog configuration to display all posts on a single page instead of paginating with 10 posts per page.

What Changed

  • Updated postsPerPage from 10 to 'ALL' in website/docusaurus.config.js
  • Blog now shows all 22+ posts on a single page
  • Posts are automatically organized by year in the sidebar navigation

Why This Change

Users were unable to discover older blog posts because they were hidden behind pagination. With only the first 10 posts visible by default, readers had no easy way to browse the complete changelog history.

Benefits

  • Improved discoverability - All posts are now visible without clicking through pagination
  • Better user experience - Simpler navigation with all content in one place
  • Year-based organization - Docusaurus automatically groups posts by year
  • Better for SEO - All content indexed on a single page

Testing

  • ✅ Website builds successfully (npm run build)
  • ✅ All 22 blog posts appear on the blog index page
  • ✅ Posts are organized by year (2025)
  • ✅ No pagination controls present

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Blog now shows all posts on a single page (no pagination).
    • Blog sidebar lists all posts and displays an updated header ("All posts").
    • Sidebar can optionally group posts by year and month, with collapsible month groups and sensible initial expansion for the most recent months.

@github-actions github-actions Bot added the size/xs Extra small size PR label Oct 30, 2025
@coderabbitai

coderabbitai Bot commented Oct 30, 2025 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Updated Docusaurus blog configuration to show all posts on one page and updated sidebar labels; added a new BlogSidebarContent React component that can group sidebar items by year and collapsible months, rendering either a grouped hierarchy or a flat list.

Changes

Cohort / File(s) Change Summary
Blog configuration updates
website/docusaurus.config.js
Changed blog.postsPerPage from 10 to 'ALL'; added blog.blogSidebarCount: 'ALL'; added blog.blogSidebarTitle: 'All posts'.
Blog sidebar UI component
website/src/theme/BlogSidebar/Content/index.tsx
Added new BlogSidebarContent default-export component. Implements grouping by year and month, helpers to group items, collapsible month groups, initial-open logic for the most recent month, accessible roles, and renders either grouped Year->Month->List or a flat ListComponent. Exports a memoized component.

Sequence Diagram(s)

sequenceDiagram
  participant Theme as Docusaurus Theme
  participant Sidebar as BlogSidebarContent
  participant Year as YearGroup
  participant Month as CollapsibleMonthGroup
  participant List as ListComponent

  Theme->>Sidebar: render(items, ListComponent, config)
  alt groupByYear enabled
    Sidebar->>Year: group items by year (descending)
    Year->>Month: group items by month (descending) and compute initialOpen
    Month->>List: render month items (collapsible)
    Month-->>Sidebar: emit expand/collapse events
  else groupByYear disabled
    Sidebar->>List: render flat items list
  end
  Sidebar-->>Theme: rendered sidebar DOM
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Inspect grouping logic and sorting (year/month) for correctness and edge cases (empty groups).
  • Verify initial-open month selection and collapse/expand state handling.
  • Check accessibility attributes and interactions with the provided ListComponent.

Possibly related PRs

  • Add Announcements Blog #1161 — modifies Docusaurus blog configuration including postsPerPage, likely related to showing all posts in the blog list.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "Show all blog posts on single page" directly aligns with the primary objective of the changeset, which centers on modifying the blog configuration to display all posts on a single page instead of using pagination. The main code change updates postsPerPage from 10 to 'ALL' in docusaurus.config.js, and the title captures this essential change clearly. The title is concise, specific, and avoids vague language—a developer scanning history would immediately understand the core intent of this PR.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch show-all-blog-posts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Oct 30, 2025 •

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@codecov

codecov Bot commented Oct 30, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.93%. Comparing base (e811da0) to head (ad64479).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1731      +/-   ##
==========================================
+ Coverage   68.92%   68.93%   +0.01%     
==========================================
  Files         381      381              
  Lines       34930    34930              
==========================================
+ Hits        24074    24079       +5     
+ Misses       8592     8588       -4     
+ Partials     2264     2263       -1     
Flag Coverage Δ
unittests 68.93% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@osterman Erik Osterman (Cloud Posse) (osterman) added the no-release Do not create a new release (wait for additional code changes) label Oct 30, 2025
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 30, 2025
Extended blog sidebar with collapsible month sections. Only the most recent
month is expanded by default, older months are collapsed to reduce clutter.

Features:
- Clickable month headings with chevron icons (like docs sidebar)
- Auto-expand most recent month (October 2025)
- Smooth rotation animation on chevron (0deg → 90deg)
- Accessible with aria-expanded attribute
- Year/Month hierarchy: 2025 > October > Posts

Configuration changes:
- blogSidebarCount: 'ALL' - Show all posts in sidebar
- blogSidebarTitle: 'All posts' - Updated title
- postsPerPage: 'ALL' - Disable pagination

Implementation:
- Swizzled @docusaurus/theme-classic BlogSidebar/Content component
- Custom groupBlogSidebarItemsByYearMonth() function
- CollapsibleMonthGroup component with React state
- Nested year/month headings with proper styling

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
website/src/theme/BlogSidebar/Content/index.tsx (1)

73-140: Refactor inline styles to CSS classes and enhance accessibility.

The component has extensive inline styles (lines 89-137) that should be extracted to CSS classes for better maintainability. Additionally, accessibility could be improved with aria-controls linking.

Consider extracting styles to a CSS module:

// In a separate .module.css file
.monthGroup {
  margin-left: 0.5rem;
}

.monthButton {
  display: flex;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.chevronIcon {
  margin-right: 0.5rem;
  transition: transform 0.2s;
}

.chevronIcon.open {
  transform: rotate(90deg);
}

.monthHeading {
  font-size: 0.875rem;
  margin: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ifm-color-gray-600);
  opacity: 0.8;
}

Then update the component:

 function CollapsibleMonthGroup({
   year,
   month,
   monthGroupHeadingClassName,
   children,
   isDefaultOpen,
 }: {
   year: string;
   month: string;
   monthGroupHeadingClassName?: string;
   children: React.ReactNode;
   isDefaultOpen: boolean;
 }) {
   const [isOpen, setIsOpen] = useState(isDefaultOpen);
+  const contentId = `month-${year}-${month}`;
 
   return (
-    <div role="group" style={{marginLeft: '0.5rem'}}>
+    <div role="group" className={styles.monthGroup}>
       <button
         onClick={() => setIsOpen(!isOpen)}
-        style={{...}}
+        className={styles.monthButton}
         aria-expanded={isOpen}
+        aria-controls={contentId}
       >
         <svg
           viewBox="0 0 16 16"
           width="12"
           height="12"
-          style={{...}}
+          className={`${styles.chevronIcon} ${isOpen ? styles.open : ''}`}
         >
           <path
             fill="currentColor"
             d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"
           />
         </svg>
         <Heading
           as="h4"
           className={monthGroupHeadingClassName}
-          style={{...}}
+          className={styles.monthHeading}
         >
           {month}
         </Heading>
       </button>
-      {isOpen && <div>{children}</div>}
+      {isOpen && <div id={contentId}>{children}</div>}
     </div>
   );
 }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between abe4e78 and 869953b.

📒 Files selected for processing (2)
  • website/docusaurus.config.js (1 hunks)
  • website/src/theme/BlogSidebar/Content/index.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
website/**

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

website/**: Update website documentation in website/ when adding features
Ensure consistency between CLI help text and website documentation
Follow the website's documentation structure and style
Keep website code in website/ and follow its architecture/style; test changes locally
Keep CLI and website documentation in sync; document new features with examples and use cases

Files:

  • website/src/theme/BlogSidebar/Content/index.tsx
  • website/docusaurus.config.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: Build (windows)
  • GitHub Check: Build (linux)
  • GitHub Check: Build (macos)
  • GitHub Check: website-deploy-preview
  • GitHub Check: Run pre-commit hooks
  • GitHub Check: Review Dependency Licenses
  • GitHub Check: Lint (golangci)
  • GitHub Check: autofix
  • GitHub Check: Analyze (go)
  • GitHub Check: Summary
🔇 Additional comments (3)
website/src/theme/BlogSidebar/Content/index.tsx (2)

58-71: LGTM!

Clean implementation with proper accessibility attributes and semantic structure.


142-190: The review comment is incorrect.

Docusaurus supports themeConfig.blog.sidebar.groupByYear with a default value of true, so the grouping feature is enabled by default without requiring explicit configuration in docusaurus.config.js. The component correctly checks this option, and it will work as intended with Docusaurus's default settings.

No action needed—the code is properly implemented.

Likely an incorrect or invalid review comment.

website/docusaurus.config.js (1)

188-200: No configuration changes needed.

The blog configuration doesn't set groupByYear, which is correct. The BlogSidebarContent component checks for this setting with a conditional—when undefined, it renders a flat list instead of grouping by year. This is intentional fallback behavior and works as designed. The 24 blog posts loading on a single page are a reasonable volume that won't cause meaningful performance issues.

@aknysh

Copy link
Copy Markdown
Member

CodeRabbit (@coderabbitai) please review if your comment "Fix hardcoded locale and month names for i18n compatibility" was addressed

@coderabbitai

coderabbitai Bot commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Fetch CodeRabbit review comments on this PR to find the specific i18n comment
gh api /repos/cloudposse/atmos/pulls/1731/comments --jq '.[] | select(.user.login == "coderabbitai[bot]") | {id: .id, path: .path, body: .body, created_at: .created_at}' | jq -s '.'

Length of output: 3862


🏁 Script executed:

#!/bin/bash
# Read the BlogSidebar Content component to check for hardcoded locale/month names
cat website/src/theme/BlogSidebar/Content/index.tsx

Length of output: 6035


🏁 Script executed:

#!/bin/bash
# Read the docusaurus config to check for locale settings
cat website/docusaurus.config.js

Length of output: 12474


Andriy Knysh (@aknysh) Yes, my comment about fixing hardcoded locale and month names for i18n compatibility has been properly addressed! Here's what was fixed:

✅ Locale hardcoding (Line 34)

  • Changed from 'en-US' to 'default', which now respects the site's i18n configuration

✅ Invalid date handling (Lines 26-29)

  • Added validation check: if (isNaN(date.getTime())) with a console warning for invalid dates

✅ Month sorting with hardcoded names (Lines 57-59)

  • Now uses numeric monthNum values (0-11 from date.getMonth()) for sorting instead of a hardcoded English month names array
  • Sorts using b[1].monthNum - a[1].monthNum for descending chronological order

The implementation follows the suggested approach with a MonthData interface that stores both the items and the numeric month value, ensuring reliable sorting regardless of locale. The code will now work correctly with different i18n configurations.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 0

🧹 Nitpick comments (2)
website/src/theme/BlogSidebar/Content/index.tsx (2)

86-153: Consider extracting inline styles for better maintainability.

The component works well, but the extensive inline styles (lines 102-150) could make future maintenance and theming adjustments more challenging. Consider moving these to CSS modules or a separate stylesheet.

Example approach:

// In a separate CSS module file
import styles from './CollapsibleMonthGroup.module.css';

// Then in the component:
<div role="group" className={styles.monthGroup}>
  <button 
    className={styles.monthButton}
    aria-expanded={isOpen}
    ...

This would centralize styling and make it easier to maintain consistency across the theme.


155-203: Solid implementation with correct conditional rendering.

The component properly handles both grouped and flat modes. The logic for determining the default open month (lines 164-172) is correct, though it could be slightly more concise using iteration patterns.

The firstMonthKey logic could be simplified to:

// Determine the most recent month (first in iteration order).
const firstEntry = itemsByYearMonth.entries().next().value;
const firstMonthKey = firstEntry 
  ? `${firstEntry[0]}-${firstEntry[1].keys().next().value}`
  : null;

But the current implementation is clear and readable, so this is purely optional.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 869953b and ad64479.

📒 Files selected for processing (1)
  • website/src/theme/BlogSidebar/Content/index.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
website/**

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

website/**: Update website documentation in website/ when adding features
Ensure consistency between CLI help text and website documentation
Follow the website's documentation structure and style
Keep website code in website/ and follow its architecture/style; test changes locally
Keep CLI and website documentation in sync; document new features with examples and use cases

Files:

  • website/src/theme/BlogSidebar/Content/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: Build (windows)
  • GitHub Check: Build (linux)
  • GitHub Check: Run pre-commit hooks
  • GitHub Check: website-deploy-preview
  • GitHub Check: autofix
  • GitHub Check: Review Dependency Licenses
  • GitHub Check: Lint (golangci)
  • GitHub Check: Analyze (go)
  • GitHub Check: Summary
🔇 Additional comments (4)
website/src/theme/BlogSidebar/Content/index.tsx (4)

1-10: Clean imports and proper attribution.

The imports are well-organized and include all necessary dependencies for the component's functionality.


13-69: Previous i18n and validation concerns successfully resolved.

The grouping logic now properly:

  • Validates dates and handles invalid entries gracefully (lines 27-30)
  • Uses 'default' locale to respect site configuration (line 34)
  • Sorts by numeric month values rather than hardcoded names (lines 56-58)

All major issues from the previous review have been addressed.


71-84: Well-structured year group wrapper.

Good use of semantic HTML and accessibility attributes with the role="group" pattern.


204-204: Good use of memoization.

Wrapping the component in memo helps prevent unnecessary re-renders.

@aknysh
Andriy Knysh (aknysh) merged commit 2492e7e into main Oct 31, 2025
@aknysh
Andriy Knysh (aknysh) deleted the show-all-blog-posts branch October 31, 2025 02:52
@github-actions

Copy link
Copy Markdown

These changes were released in v1.197.0-test.0.

This branch was successfully deployed

No deployments
preview — ad64479e Deployed Oct 31, 2025 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-release Do not create a new release (wait for additional code changes) size/m Medium size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants