Skip to main content

4 posts tagged with "docusaurus"

docusaurus tag description

View All Tags

Enable "Last Updated" Docusaurus Dates on Vercel

· 5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Docusaurus provides a powerful feature that displays the last updated time and last updated author for every blog post and documentation page. However, when deploying a Docusaurus website on Vercel, many developers encounter the same confusing issue:

Every page shows the exact same "last updated" date - or no date at all.

This guide explains precisely why this happens and the exact configuration you must enable on Vercel to make Docusaurus timestamps work correctly.

Create image sitemap file for Docusaurus

· 4 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Docusaurus doesn't have a built-in feature to create a separate image sitemap. The @docusaurus/plugin-sitemap only handles generating a sitemap for your pages and documentation, not for media like images.

Since the plugin doesn't have a specific option for image sitemaps, the recommended approach is to manually create an XML file that follows the image sitemap protocol and place it in the static directory of your Docusaurus project.

How to Display Blog and Documentation Counts in Docusaurus

· 6 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Adding a metric counter that displays the total number of blog articles and documentation pages is a great way to make a Docusaurus site feel active.

However, since Docusaurus compiles your pages statically, you cannot call internal hooks like useBlogPosts() inside static landing pages (such as src/pages/index.js). Doing so causes server-side rendering (SSR) failures during build execution on platforms like Vercel.

This guide provides a robust, build-time solution that counts flat files, subdirectories, and nested folders, saving the results to a static JSON file that can be safely imported anywhere in your project.

How to Display Blog Post Count on Docusaurus Homepage

· 4 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

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's a simple and reliable way to implement this-no hacks, no unstable APIs, just clean engineering.