Blogging with Jekyll
I’m very much a fan of Markdown for all kinds of documentation and use it where ever I would have used Word (shivers!!) or LaTeX in the past. This makes Jekyll for blogging a done deal.
The code is hosted on GitHub.
The site is hosted on GitHub Pages at ondfisk.dk.
Development
Working with Jekyll locally is made easy using a development container (requires Docker):
.devcontainer/devcontainer.json
:
{
"name": "Jekyll",
"image": "mcr.microsoft.com/devcontainers/jekyll:dev-3.3-bookworm",
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"davidanson.vscode-markdownlint",
"esbenp.prettier-vscode",
"github.vscode-pull-request-github",
"redhat.vscode-yaml",
"shopify.ruby-extensions-pack",
"streetsidesoftware.code-spell-checker"
]
}
}
}
Debug
To run the site locally (using WSL2):
git clone https://github.com/ondfisk/ondfisk.github.io.git
cd ondfisk.dk
code .
# Open dev container
cd blog
bundle update
jekyll serve
CI/CD
Build and deploy using GitHub Actions:
.github/workflows/pages.yml
:
name: Deploy site to Pages
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
working-directory: blog/
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
run: |
bundle exec jekyll build --baseurl "$"
env:
JEKYLL_ENV: production
working-directory: blog/
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: blog/_site
deploy:
environment:
name: github-pages
url: $
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Inspired by Getting started with Jekyll blog hosted on Azure static website.