Ah, yes, another case of Not Invented Here(TM) syndrome. I wanted to have a place to publish my thoughts, ideas, and experiences, sorted by date, and with the idea of being able to find things later, record my learnings, discoveries in other fields than programming and computers.
https://github.com/mgmerino/journal-rb
There are already plenty of generators and bloggin tools, but not the one I wanted. So I wrote my own stealing great ideas from other generators and bloggin tools. Ah, I forgot to mention: this will be local first, and then I will deploy it to a static hosting service. Not sure yet where and how.
A minimal static site generator that converts Markdown posts to HTML. Built with Ruby, it features a clean interface with tag filtering, theme switching, and a random post navigator.
How It Works
This publishing system follows a simple pipeline:
Markdown files (content/) → Ruby build script → Static HTML (public/)
Build Process
The build script (build.rb) orchestrates the entire publishing workflow:
- Load and Parse Posts
- Scans
content/posts/*.mdfor Markdown files - Extracts YAML front matter (title, date, tags, slug)
- Converts Markdown to HTML using Kramdown
- Calculates word counts and sorts posts by date
- Scans
- Generate Tag System
- Collects all unique tags from posts
- Assigns consistent colors to each tag
- Creates filterable tag lists for the “All Posts” page
- Build Pages
- Individual posts (
/posts/{slug}/): Full article with tags and metadata - Recent (
/and/recent/): Homepage showing the 10 most recent posts - All posts (
/all/): Sortable, filterable list with word counts - About (
/about/): Static page fromcontent/about.md
- Individual posts (
- Copy Assets
- Copies CSS from templates to public directory
- Copies images from
content/img/topublic/img/
- Generate JSON Index
- Creates
posts.jsonfor random post navigation
- Creates
Template System
Templates use simple placeholder substitution:
layout.html: Main wrapper with navigation, header, footerentry.html: Single post layoutrecent-entry.html: Post format for homepageall-item.html: List item for “All Posts” page- Placeholders like
{{content}},{{title}},{{body}}are replaced with actual content