A handmade, lightweight blog engine built from scratch with Elixir. This is a custom-crafted solution that serves markdown articles with YAML front matter support, designed for simplicity and speed.
This project is a handbuilt web server that compiles and serves markdown articles at startup. Articles are stored in memory for fast access and compiled from markdown files with optional YAML front matter for metadata. Every component was thoughtfully selected and integrated to create a minimal, efficient blogging platform.
- ✅ Compile articles on startup for fast serving
- ✅ Serve articles from memory for speed
- ✅ Read front matter YAML from markdown files for metadata
- ✅ Directory structure-based URL routing
This blog engine was built from the ground up using carefully chosen libraries:
- Bandit - Modern HTTP/1.1 and HTTP/2 server for fast, concurrent request handling
- Plug - Composable web application framework providing the routing and middleware foundation
- Earmark - Pure Elixir markdown parser for converting content to HTML
- YamlElixir - YAML parser for processing article front matter metadata
This engine embraces simplicity over complexity:
- Memory-first: Articles compiled once at startup, served from RAM
- Minimal dependencies: Only essential libraries, no heavyweight frameworks
- File-based content: Simple markdown files with optional YAML metadata
Boc.Router- Handles HTTP routing and article servingBoc.Articles.DB- In-memory article storage using AgentBoc.Articles- Article compilation and processing pipelineBoc.Markdown- Markdown parsing with front matter extractionBoc.Layout- EEx template rendering system
- Elixir 1.18 or later
- Mix build tool
- Clone the repository
- Install dependencies:
mix deps.get
Start the development server:
mix run --no-haltThe server will start and compile all markdown articles from priv/articles/ into memory.
- Create markdown files in
priv/articles/ - Optionally add YAML front matter for metadata:
--- title: "My Article Title" date: "2024-01-01" --- # Article Content Your markdown content here...
- Restart the server to compile new articles
/- Serves the home article (priv/articles/home.md)/:key- Serves article with matching filename (without extension)
Run tests with:
mix test