A stunning, modern static blog built with YOCaml - featuring Apple-inspired design with smooth animations, Lottie graphics, and an exceptional user experience.
π Live Site: https://Dev-JoyA.github.io/yocaml_blog
- π¨ Apple-inspired Design - Clean, modern UI with glassmorphism and blur effects
- β¨ Lottie Animations - Smooth, engaging animations throughout the site
- π± Fully Responsive - Beautiful on desktop, tablet, and mobile
- π Lightning Fast - Static site generation for optimal performance
- π Markdown Support - Write content in Markdown with YAML frontmatter
- π·οΈ Tag System - Organize articles with tags
- π° ATOM Feed - RSS/ATOM feed for syndication
- π― SEO Optimized - Semantic HTML and meta tags
- π Smooth Scrolling - Delightful navigation experience
yocaml_blog/
βββ .github/
β βββ workflows/
β βββ deploy.yml # GitHub Actions deployment
βββ _build/ # Build artifacts (git-ignored)
βββ _opam/ # Local opam switch (git-ignored)
βββ _www/ # Generated site (git-ignored)
β βββ articles/ # Generated article pages
β βββ images/ # Copied images
β βββ style.css # Concatenated CSS
β βββ atom.xml # RSS/ATOM feed
β βββ index.html # Homepage
β βββ about.html # About page
β βββ contact.html # Contact page
βββ assets/
β βββ css/
β β βββ reset.css # CSS reset
β β βββ style.css # Main stylesheet
β βββ images/
β β βββ icons.svg # SVG icons
β βββ templates/
β βββ layout.html # Base layout
β βββ page.html # Page template
β βββ article.html # Article template
β βββ index.html # Homepage template
βββ bin/
β βββ dune # Executable configuration
β βββ joy_blog.ml # Main generator
βββ content/
β βββ articles/ # Article markdown files
β β βββ my-first-article.md
β βββ pages/ # Page markdown files
β β βββ about.md
β β βββ contact.md
β βββ index.md # Homepage content
βββ .gitignore # Git ignore rules
βββ dune-project # Dune project config
βββ joy_blog.opam # OPAM package (auto-generated)
βββ README.md # This file
- OCaml 5.3.0 or higher
- opam 2.0 or higher
- dune 3.0 or higher
- Clone the repository:
git clone https://github.com/Dev-JoyA/yocaml_blog.git
cd yocaml_blog- Create local opam switch:
opam switch create . 5.3.0
eval $(opam env)- Install dependencies:
opam install . --deps-only --yes- Build the blog:
dune build
dune exec joy_blog- View locally:
Since the YOCaml server has some issues, use Python's HTTP server:
dune exec joy_blog server
cd _www
python3 -m http.server 8000Then visit: http://localhost:8000
When you make changes:
# 1. Rebuild the site
dune exec joy_blog
# 2. View changes
cd _www && python3 -m http.server 8000Or use watch mode (requires entr or similar):
# Install entr (macOS)
brew install entr
# Auto-rebuild on file changes
ls bin/*.ml content/**/*.md assets/**/* | entr -r sh -c 'dune exec joy_blog'Create content/articles/my-article.md:
---
title: My Awesome Article
description: A brief description
date: 2025-11-03
tags: [ocaml, functional-programming, yocaml]
---
# My Awesome Article
Your **markdown** content here!Required fields:
title- Article titledate- Publication date (YYYY-MM-DD)
Optional fields:
description- Brief summarytags- Array of tags
Create content/pages/my-page.md:
---
page_title: My Page
description: Page description
tags: [info]
---
# Page Content
Your content here!Edit content/index.md to customize your homepage.
Edit assets/css/style.css - customize CSS variables:
:root {
--apple-blue: #007aff;
--apple-purple: #af52de;
--apple-pink: #ff2d55;
/* ... modify colors, spacing, etc. */
}Templates use Jingoo (Jinja2-like):
assets/templates/layout.html- Navigation & footerassets/templates/page.html- Regular pagesassets/templates/article.html- Blog articlesassets/templates/index.html- Homepage with article list
Update bin/joy_blog.ml in the Feed module:
module Feed = struct
let title = "Your Blog Title"
let site_url = "https://yourdomain.com"
let feed_description = "Your description"
let owner =
Yocaml_syndication.Person.make
~uri:site_url
~email:"your@email.com"
"Your Name"
endThis blog is configured for automatic deployment via GitHub Actions.
How it works:
- Push to
mainbranch - GitHub Actions builds the site
- Deploys to GitHub Pages automatically
- Live at: https://Dev-JoyA.github.io/yocaml_blog
Workflow file: .github/workflows/deploy.yml
1. Add CNAME file:
Create content/CNAME:
yourdomain.com
2. Update bin/joy_blog.ml:
Add CNAME copy function:
let copy_cname =
let cname_file = Path.(content / "CNAME") in
Action.copy_file ~into:www cname_file
let program () =
let open Eff in
let cache = Path.(www / ".cache") in
Action.restore_cache cache
>>= copy_images
>>= copy_cname
>>= create_css
>>= create_pages
>>= create_articles
>>= create_index
>>= create_feed
>>= Action.store_cache cacheUpdate site URL:
module Feed = struct
let site_url = "https://yourdomain.com" (* Your domain *)
(* ... *)
end3. Configure DNS (at your domain registrar):
For apex domain:
Type: A, Name: @, Value: 185.199.108.153
Type: A, Name: @, Value: 185.199.109.153
Type: A, Name: @, Value: 185.199.110.153
Type: A, Name: @, Value: 185.199.111.153
For www subdomain:
Type: CNAME, Name: www, Value: Dev-JoyA.github.io
4. Configure GitHub Pages:
- Go to: Settings β Pages
- Custom domain: Enter
yourdomain.com - Wait for DNS to propagate (24-48 hours)
- Enable "Enforce HTTPS"
5. Push changes:
git add .
git commit -m "Add custom domain"
git push origin mainBuild and deploy manually:
# Build
dune exec joy_blog
# Deploy _www contents to your hosting
rsync -avz _www/ user@yourserver:/var/www/html/# Build project
dune build
# Generate site
dune exec joy_blog
# Clean build artifacts
dune clean
# Update dependencies
opam update && opam upgrade
# Install new dependency
opam install package-name
# View locally with Python
cd _www && python3 -m http.server 8000- YOCaml - Static site generator
- OCaml 5.3.0 - Programming language
- Dune - Build system
- Jingoo - Template engine
- Cmarkit - Markdown parser
- Lottie - Animations
- Inter Font - Typography
The YOCaml development server may hang. Use Python instead:
dune exec joy_blog # Build site
cd _www && python3 -m http.server 8000 # Serve locallyIf you see escaped HTML like <div>, add | safe filter:
{{ yocaml_body | safe }}- Check Actions tab for build errors
- Ensure Settings β Pages β Source is "GitHub Actions"
- Clear browser cache
- Wait a few minutes for deployment
# Clean and rebuild
dune clean
dune build
opam install . --deps-only --yes
dune exec joy_blogContributions welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
MIT License - use freely for your own blog!
Joy Aruku
- GitHub: @Dev-JoyA
- Website: Dev-JoyA.github.io/yocaml_blog
- YOCaml team for the excellent SSG
- OCaml community
- Apple for design inspiration
- LottieFiles for animations
Built with β€οΈ using OCaml and YOCaml