Skip to main content

Front Matter CMS: templates, snippets and custom actions

· 28 min read ·
Docux
Curious explorer, a bit of a mad experimenter, and a bit of a contributor.

Developer Development License: MIT

illustration of El Dino pushing Front Matter CMS beyond its configuration

For three articles, we took Front Matter as it comes out of the box: installed, finely configured, used day to day. Nothing we added to the tool itself.

This article changes register. We are going to extend Front Matter: teach it to pre-fill articles, to insert ready-made blocks, to expose our own buttons in the panel, and to store its configuration across several files rather than one 450-line frontmatter.json. This is the moment the extension stops being a form and becomes part of the repository's tooling.

What you'll be able to do by the end

Create a pre-filled article from a template, define snippets for your recurring MDX components, add a home-made button that runs a Node script, and split frontmatter.json into thematic files under .frontmatter/config/.

Front Matter CMS day to day: dashboard, filters and media

· 12 min read ·
Docux
Curious explorer, a bit of a mad experimenter, and a bit of a contributor.

Developer Development License: MIT

illustration of El Dino in front of the Front Matter dashboard

In the previous article, we built a custom content type: the form knows our fields, the lists feed themselves, manual typing has almost disappeared. Configuration is behind us.

This article is about what comes after: the weeks when you no longer open frontmatter.json. Writing, finding, classifying, illustrating — the routine. This is where the real question asked at the start of this series plays out: does the tool hold up once the novelty wears off?

What you'll be able to do by the end

Write and preview an article without leaving VS Code, find it again in three clicks in the dashboard, filter and group by series (not just by tags), merge duplicate tags across the whole blog in one go, and manage your images from the built-in media library.

Install and configure Front Matter CMS on Docusaurus

· 15 min read ·
Docux
Curious explorer, a bit of a mad experimenter, and a bit of a contributor.

Developer Development License: MIT

illustration of El Dino using Front Matter CMS

In the previous article, we saw why Front Matter CMS is worthwhile on a Docusaurus project. Let's get practical.

Installation takes two minutes and the extension guides us through it. The real work — the part that makes the difference between a gadget and a tool you use every day — is to match the CMS to your own front matter schema. And, as we'll see, to have the courage to model only what actually serves a purpose.

What you'll be able to do by the end

Wire Front Matter into an existing Docusaurus site, understand the main frontmatter.json settings, translate your front matter into a form, and remove manual typing wherever possible.

Why Front Matter CMS with Docusaurus

· 11 min read ·
Docux
Curious explorer, a bit of a mad experimenter, and a bit of a contributor.

Developer Development License: MIT

Front Matter CMS paired with Docusaurus

If you have been maintaining a Docusaurus site for a while, you know this scene: opening an .mdx file, scrolling all the way up to edit the front matter by hand, and hoping you did not make a typo on sidebar_label or forget a comma in tags. No validation, no overview of what is published, in draft or outdated. And to check the rendering, you have to run npm run start and navigate to the right page.

That is exactly the gap Front Matter CMS fills.

What you will find in this first article of a long series about Front Matter CMS

A general overview: what Front Matter is, what it brings, who it is for and above all what it does not do. This is the first part of a series that will then go all the way to the real configuration used on this blog.

A Docusaurus Plugin to Optimize Images at Build Time

· 5 min read ·
Docux
Curious explorer, a bit of a mad experimenter, and a bit of a contributor.

Developer Development License: MIT AI 90%

My blog was quietly shipping 13.7 MB of images. A few PNGs weighed over a megabyte, and several WebP files were surprisingly heavy — over-sized dimensions and default encoder quality. Heavy images hurt load time, Core Web Vitals, and ultimately SEO. So I built a small local Docusaurus plugin that optimizes every image at build time, and it cut the deployed images almost in half (-49%) — without touching a single source file.

This article walks through the plugin: how it hooks into the build, how a content-hash cache makes it incremental (already-optimized images become a reusable artifact), and the real numbers it produced.

Design goals

Non-destructive (never modify sources), incremental (process new images only), and reference-safe (formats are preserved, so no URL ever breaks).

ESLint and Prettier in a Docusaurus Blog

· 6 min read ·
Docux
Curious explorer, a bit of a mad experimenter, and a bit of a contributor.

Developer Development License: MIT AI 90%

For a long time this blog had no linter and no formatter. Files drifted into different styles (some indented with 4 spaces and single quotes, others with 2 spaces and double quotes), and nothing was watching for the small mistakes that slip into any React codebase. So I finally added ESLint and Prettier — and to my surprise, the linter immediately found real bugs that had been hiding in plain sight.

This article explains what these two tools actually do, how I configured them for a modern Docusaurus (React 19, a few TypeScript components, custom plugins), and — the fun part — the concrete issues ESLint caught in my own code.

Two tools, two jobs

Prettier handles form (how the code looks). ESLint handles substance (whether the code is correct). They complement each other; they don't compete.

API at build time with github Action

· 4 min read ·
Docux
Curious explorer, a bit of a mad experimenter, and a bit of a contributor.

Developer Development License: MIT AI 50%

Here I show a simple yet realistic example: using an API during Docusaurus build, saving the result in a static JSON file, and then displaying this data in a page or component.

This type of workflow is ideal for keeping a static site in production while leveraging external data at compile time. But beware: not all APIs can be easily queried from a CI server (GitHub Actions). We will see how to bypass blocking (Cloudflare) and set up a robust fallback.

Component TimeTimer

· 12 min read ·
Docux
Curious explorer, a bit of a mad experimenter, and a bit of a contributor.

Developer Development License: MIT AI 50%

The Time Timer is an innovative visual tool designed to "materialize" the passage of time, allowing for better activity management by making the remaining time visible. It comes in the form of a timer with an analog dial featuring a colored disk, often red on a white background, which gradually shrinks as the countdown progresses until the final alarm or color change. This device, invented by Jan Rogers to help her daughter better understand transitions between activities, is particularly useful for children who struggle with the concept of elapsed time, but also for adults. It's used to visualize the remaining time for a task, whether for homework, classes, playtime, or other daily activities, thus promoting autonomy, concentration, and time management.

While observing my daughter's Time Timer, I had the idea to develop the TimeTimer component to solve a simple need: displaying content only at certain dates or during specific periods. Whether for promotional offers, seasonal events, or temporary announcements, this component allows you to automate the display without having to manually modify your pages.

Bonus: at the end of this article, you'll discover how I created an Advent calendar with my TimeTimer component!

Creating Custom 404 Page

· 4 min read ·
Docux
Curious explorer, a bit of a mad experimenter, and a bit of a contributor.

Developer Development License: MIT AI 0%

The default 404 page in Docusaurus is functional, but quite basic. For many years now, it has become a page that allows you to stand out even though it's the result of a website flaw (broken link or unredirected URL). Building a stylish 404 page is therefore an opportunity to provide a better experience when a link breaks. Here's how I set up a custom 404 with Docusaurus, keeping the page lightweight and responsive.

GoatCountViews Component

· 3 min read ·
Docux
Curious explorer, a bit of a mad experimenter, and a bit of a contributor.

Developer Development License: MIT AI 65%

After adding Goatcounter to my blog, I wanted to display view counts for each page. My goals were to:

  • Display the number of views for a page
  • In the article list, show the views for each post individually
  • Avoid HTML injection and the "flash" of unparsed content (common when using JavaScript or the iframe)

So I created this component using GoatCounter's JSON API.

Official Goatcounter docs for this: View counts

Back to top