Development

Moving my site to Jekyll and GitHub Pages

Why I am moving my personal site off dynamic PHP hosting to static HTML built with Jekyll 2.0 and hosted on GitHub Pages for speed, security and a cleaner Git workflow.

A personal portfolio and blog does not change every second. Maybe I publish a new article once a month, or add a new project every few months. Yet for years I kept paying for shared PHP hosting so a server could run scripts and assemble the exact same HTML pages over and over for every single visitor.

This summer I decided to simplify the whole thing and move my personal site completely over to Jekyll and GitHub Pages.

Why pre-built static HTML is so fast

Jekyll is a static site generator written in Ruby by Tom Preston-Werner. Instead of generating pages on the fly when someone visits a URL, Jekyll builds the entire website once into plain HTML, CSS and JavaScript files.

For a site like mine, the difference is immediate:

  • Pages load almost instantly because the server is only sending static files with zero PHP execution and zero database queries.
  • There is no admin login to brute-force, no WordPress plugins to patch every week and no MySQL server to crash if a post gets a spike in traffic.
  • All my articles stay as portable Markdown files that I can write in iA Writer or Sublime Text and track in Git.

With Jekyll 2.0 coming out back in May, it even added native Sass support directly, which means I can keep using my indented .sass files without setting up an extra build step just to compile CSS.

A clean folder structure with Markdown and Liquid

What won me over when testing Jekyll is how transparent the project structure is. Everything sits in a few plain folders:

_config.yml
_includes/
  header.html
  footer.html
_layouts/
  default.html
  post.html
_posts/
  2014-07-22-moving-to-jekyll.md
css/
  main.sass
CNAME

Writing a new blog post just means adding a dated file inside _posts/ with a small YAML front matter block at the top:

---
layout: post
title: Moving my site to Jekyll and GitHub Pages
date: 2014-07-22
---

Plain Markdown content goes right here.

Templates use Liquid, which is simple enough to pick up in an afternoon if you have ever written PHP templates or Jade partials. Running jekyll serve --watch spins up a local preview server and rebuilds the site automatically every time you save a file.

Deploying with git push on GitHub Pages

The second half of why this setup works so well is GitHub Pages.

If you push your Jekyll repository to username.github.io, GitHub builds the site automatically and hosts the generated static files for free. Dropping a plain CNAME file with your domain name into the root of the repo lets you connect your own custom domain in a couple of minutes.

Publishing a new post or fixing a typo is literally git commit and git push. No FTP client, no cPanel, no staging database dumps, and no monthly shared hosting bills for a personal site that doesn't need a backend.

Not for every project, but ideal for my own

For client websites where non-technical editors need a visual admin interface to upload images and edit pages, a CMS like Kirby or WordPress is still the right tool.

For my own site, portfolio and writing though, switching completely to Jekyll and GitHub Pages makes total sense. Everything is faster, safer, versioned in Git and much easier to maintain over the years.

Get in touch

If you want to chat about Embedded Development, Design Systems, or just say hello, feel free to reach out. I speak English, Italian, Ukrainian, and Russian, and I'm always open to a conversation.

E-mail LinkedIn