Skip to main content

Improved: Count Blog Posts in Docusaurus Including Folders

4 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

馃攧 Update to: Count Number of Blog Posts in Docusaurus and Vercel

In my previous post, I shared a method to count the number of blog posts in a Docusaurus project and display it on your homepage, fully compatible with Vercel and static builds.

That method works great-if all your blog posts are plain .md or .mdx files in the blog/ directory.

But if you're like me and prefer organizing blog posts in folders (e.g., blog/my-post/index.md), the previous approach silently misses those.

How to Display Blog Post Count on Docusaurus Homepage

4 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Many developers using Docusaurus want to display the number of blog posts they have-especially on their homepage. While this may sound trivial, doing it the right way (that works on both your local dev and production builds like Vercel) requires some thought.

Here鈥檚 a simple and reliable way to implement this-no hacks, no unstable APIs, just clean engineering.

Git Rebase Onto Main (Full Guide, No Fluff)

4 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

You want to bring your feature branch up to date with the latest main, but you don鈥檛 want messy merge commits.

The solution: rebase.

Rebase reapplies your local commits on top of the latest main from remote. It keeps your commit history clean, linear, and easy to read - especially when preparing a pull request.

Looking for more content?
Hrekov Blog contains 165 articles. Browse the blog archive or Explore the full timeline.