A Self-maintaining filesystem for static blogs
2026-07-01
A Self-maintaining filesystem for static blogs
I've just finished revamping the folder structure of this blog's content to include the date in the file name as in yyyy-mm-dd-post-title.md
This finally made opening the posts folder manageable as scanning the ever-growing list of titles, was causing me to dreading opening it at all.
Recently, my guiding principle has been to remove any friction from the projects I would like to work on more.
The file structure
The typical Eleventy setup has a flat-files setup.
blog
├── post-title.md
└── another-post-title.md
But in my quest for documenting and portability, I ended up setting up this folder structure instead.
blog
└── yyyy-mm-dd-post-title
├── yyyy-mm-dd-post-title.md
└── image.png
This has a few advantages:
- Co-location of a post's assets, images, snippets, etc.
- Holding meta information such as title and date in the file name itself, rather than a generic
index.md - Relative links in markdown easily map to their html links counterpart, once the site it's built.
Automating the boring parts
Enter Claude Code, and adapting 11ty Buildawesome to my needs is just a matter of asking AI to write some scripts that integrate with the internal 11ty Dev Server watcher.
- Updating either the Frontmatter property
dateortitlenow triggers a name change of both the file name and the folder name. - If the folder and filename change affected a live post, eg. with the Frontmatter property
draft: false, a script will update all internal links that reference the updated path, and create a redirect, by adding an entry toredirects.json
[
{
"from": "/posts/2023-02-21-how-build-minimalist-markdown-blog-eleventy/",
"to": "/posts/2023-02-21-build-minimalist-markdown-blog-eleventy/"
}
]
- If I upload an image file into a post folder, it will automatically compress it to a sensible size. No need to worry anymore about git-tracking 5MB pictures straight out of my camera roll.
- A simple
npm run new post titlecommand, creates an empty document with theyyyy-mm-dd-post-title.mdtitle slug, folder, today's date, set to draft and a scaffolded empty post.
---
date: 2026-07-01
title: "Post title"
project:
repository:
tags: []
selected: false
draft: true
description: ""
url:
---
2026-07-01
# Post title
### Resources