welcome to

Website-Bastelstunde II:
Static Site Generators

with nyakob (they/them/jakob) :3

historical WWW logo (Robert Cailliau, 1990)

29 Jun '26, maschinenraum

slides: http://jakob.ruckel.de/slides/www-ii/

<slide page="1/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />
<slide page="2/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

What does a static site generator *do*?

<slide page="3/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

A Website, built by hand

index.html

<!doctype html>
<head>
    <title>home</title>
    <link rel='stylesheet' ... />
</head>
<body>
    <h1>home on my site</h1>
    ...
</body>

links.html

<!doctype html>
<head>
    <title>links</title>
    <link rel='stylesheet' ... />
</head>
<body>
    <h1>links on my site</h1>
    ...
</body>

cat.html

<!doctype html>
<head>
    <title>cat pics</title>
    <link rel='stylesheet' ... />
</head>
<body>
    <h1>cat pics on my site</h1>
    ...
</body>
<slide page="4/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />
  • problem: this involves a lot of copy and paste and manual labor
  • we’d much prefer the computer to do that copy and paste for us
  • maybe it could, i dunno, generate this for us?
<slide page="5/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

Generating Sites

  • input:
    • Raw HTML
    • Markdown
    • Templates
    • CSS
  • output:
    • Markdown is rendered as HTML
    • Templates are applied
    • everything is put together
<slide page="6/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

Generating Sites

jekyll + someone elses pc web server ur pc html+css html+css html+css templates markdown this is ur whole site upload via (s)ftp(s)
<slide page="7/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

So, Let’s build a site then

  • reminder: the slides are online at http://jakob.ruckel.de/slides/www-ii/
    • also please yell at me if i am yapping too fast
  • Our tool of choice will be Jekyll
    • first released in ‘08, written in ruby (but you do not need Ruby for making sites)
    • pretty popular, especially because it is supported in github pages by default:
    • some alternatives:
      • hugo: very fast, uses Go templates
      • Next.js: React stuff, but supports static site generation
      • MkDocs: good for software project documentation
      • …any many more
<slide page="8/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

Step 1: Installation

  • windows:
    winget install RubyInstallerTeam.RubyWithDevKit.3.4
    ...
    
  • others:
<slide page="9/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

Step 2: hello, world

  1. simply run:
    jekyll new my-cool-site --blank
    
  2. go into the site directory:
    cd my-cool-site
    
  3. run this:
    jekyll serve --livereload
    
  4. open the url printed in your terminal (http://127.0.0.1:4000/)
  5. rejoice!
<slide page="10/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

ok what has just happened

  • take a look at index.md!
    • because it’s in the project root and called index, it is served as the root site
    • it contains the content of your cool new site
    • at the top, in between the --- is some meta data
      • this is called front matter
      • Importantly, this defines the layout for this page
<slide page="11/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

Layouts

  • layouts live in the _layouts/ directory
    • the underscore means jekyll will not process these as pages
  • if you have some cool html from three weeks ago:
    • now is a good time to copy and paste it into a layout file
    • make sure to keep the stylesheet, i.e., this line:
      <link rel="stylesheet"
             href="{{ "/assets/css/main.css" | relative_url }}">
      
    • disregard your content and replace it with {{ content }}

      • put the content in index.md instead
<slide page="12/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

Posts

  1. create a layout for posts in _layouts/post.html
    ---
    layout: default
    ---
    
    {{ content }}
    
<slide page="13/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

Posts

  1. create a post in _posts/2026-06-29-hello.md
---
title: Hello, World!
layout: post
---
this is my cool post.  hello!
<slide page="14/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

Posts

  1. view the post at http://127.0.0.1:4000/2026/06/29/hello
  2. if you want, you can change the link format in _config.yml, e.g.:
    permalink: "/post/:slug"
    

    will put your post at http://127.0.0.1:4000/post/hello note: if u change anything in _config.yml, you have to restart the jekyll server!

<slide page="15/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

Adding a list of posts

let’s add some templating to our index.md:

## posts
<ul>
{% for post in site.posts %}
<li><a href="{{ post.url | relative_url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
  • the templates are written in liquid, see here for a tutorial
  • tip: you can print out something like {{ post | inspect }} to see all properties
<slide page="16/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

Includes

  • these are smaller templates with parameters that can be included from anywhere
  • they live in _includes/
  • example: _includes/post_teaser.html:
<li>
    <a href="{{ include.post.url | relative_url }}">
        <b>{{ include.post.title }}</b>
    </a>
    posted on {{ include.post.date | date: "%Y-%m-%d" }}
    {{ post.content | split: "<!--teaser-->" | first }}
</li>
<slide page="17/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

Includes

we can then add our special HTML comment to our post below the first line:

this is my cool post.  hello!

<!--teaser-->

this is the coolest thing evuuurrrrr x3

any only the stuff above the comment will be shown for the post_teaser.html include

<slide page="18/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

Includes

then, in out index.md we can just do our list of posts like this:

<ul>
{% for post in site.posts %}
{% include post_teaser.html post=post %}
{% endfor %}
</ul>

the cool thing: we can pass data (e.g., the post) on to the Include!

<slide page="19/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

Deploying to GitLab Pages

  • i found out about this last week and this is huge actually
  • you can host at smth like https://nyakob.bau-ha.us/
  • like how cool is that?!
  1. if you don’t have an account already, register
    • i think u need an @uni-weimar.de mail
  2. create a repo called yourusernamehere.bau-ha.us
  3. commit ur website there
  4. create and commit Gemfile with the following contents:
    source "https://rubygems.org"
    gem "jekyll"
    
<slide page="20/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

last step: put this in a file called .gitlab-ci.yml:

pages:
  stage: deploy
  image: ubuntu:latest
  script:
    - apt update && apt -y install ruby-full build-essential
    - gem install bundler
    - bundle install
    - bundle exec jekyll build
    - mv _site public
  artifacts:
    paths:
      - public
<slide page="21/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

commit your changes and be amazed at the technology:

<slide page="22/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />

Happy webseiten-basteln!!

slides online at: http://jakob.ruckel.de/slides/www-ii/

<slide page="23/23" what="website-bastelstunde ii: static site generators" who="nyakob" when="29 jun '26" where="maschinenraum" />