Personal blog built with Jekyll and deployed to GitHub Pages at erict.net.
- Ruby (3.3 recommended)
- Bundler:
gem install bundler
Install dependencies:
bundle installPosts live in _posts/ and must follow Jekyll's naming convention:
YYYY-MM-DD-your-post-title.md
Each post needs front matter at the top:
---
layout: post
title: "Your Post Title"
tags: tag1 tag2
permalink:
---Drafts go in _drafts/ and are excluded from builds by default. To preview drafts locally, pass --drafts to the serve command (see below).
To build the site into _site/:
bundle exec jekyll buildFor a production build (sets JEKYLL_ENV=production, which enables Disqus comments):
JEKYLL_ENV=production bundle exec jekyll buildTo serve the site at http://localhost:4000 with live reload:
bundle exec jekyll serveTo also render drafts from _drafts/:
bundle exec jekyll serve --draftsTo serve without live reload (faster startup):
bundle exec jekyll serve --no-watchThe _site/ directory is regenerated on each build and is git-ignored.
The repo doubles as an Obsidian vault. Open the root of this repo as your vault in Obsidian.
Use the built-in template to start a new post. Open the command palette (Cmd+P) and run Templates: Insert template, then select the post template. This inserts the correct Jekyll front matter for you.
The template is stored in _obsidian-templates/. Create new post files directly in _posts/ and name them YYYY-MM-DD-your-title.md.
Obsidian is configured to save pasted or dragged images into assets/images/, which is where Jekyll expects static assets. Images will be available at /assets/images/your-image.png in posts.
The .obsidian/ directory stores your vault settings (workspace layout, enabled plugins, theme, etc.). It is git-tracked so the setup is reproducible, but it is excluded from Jekyll builds via _config.yml.
Pushing to master automatically builds and deploys the site to GitHub Pages via the workflow in .github/workflows/jekyll.yml.
- Checks out the repo
- Sets up Ruby 3.3 with Bundler caching
- Runs
bundle exec jekyll buildwithJEKYLL_ENV=production - Uploads the built
_site/as a Pages artifact - Deploys the artifact to GitHub Pages
- On every push to
master - Manually via Actions > Build and deploy Jekyll site > Run workflow in the GitHub UI
Only one deployment runs at a time. A new push to master while a deploy is in progress will queue behind it (it will not cancel the in-flight deploy).
The CNAME file contains erict.net, which tells GitHub Pages to serve the site on the custom domain. Do not delete this file.