Skip to content

Commit 1495596

Browse files
committed
Migrate from custom Clojure site generator to Jekyll
Replace the custom Clojure-based site generator with Jekyll, GitHub's built-in static site generator. This simplifies the build pipeline, reduces maintenance burden, and leverages battle-tested tooling. Changes: - Add Jekyll configuration and Gemfile - Create Jekyll layouts (default, home, page, post) - Convert 10 posts from .post (EDN frontmatter) to _posts/ (YAML frontmatter) - Convert 2 pages (about, contact) from .page to Jekyll markdown - Create index.html as Jekyll home page - Migrate GitHub Actions workflow to use Jekyll/Pages deployment - Update .gitignore for Jekyll artifacts (_site/, .jekyll-*) - Remove all Clojure generator code (src/, templates/, test/, project.clj, build.sh) - Remove obsolete documentation (CHANGELOG.md, doc/intro.md) All URLs and post metadata are preserved. Build time should improve significantly as Jekyll runs natively on GitHub Pages servers.
1 parent c8b3682 commit 1495596

33 files changed

+229
-428
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,37 @@
1-
name: build
1+
name: deploy
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: "pages"
14+
cancel-in-progress: false
615

716
jobs:
817
build:
918
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/configure-pages@v5
22+
- uses: actions/jekyll-build-pages@v1
23+
with:
24+
source: ./
25+
destination: ./_site
26+
- uses: actions/upload-pages-artifact@v3
1027

28+
deploy:
29+
environment:
30+
name: github-pages
31+
url: ${{ steps.deployment.outputs.page_url }}
32+
runs-on: ubuntu-latest
33+
needs: build
1134
steps:
12-
- uses: actions/checkout@v2
13-
with:
14-
persist-credentials: false
15-
fetch-depth: 0
16-
- name: git fetch
17-
run: git fetch
18-
- name: checkout www
19-
run: git checkout -t origin/www
20-
- name: ensure pull
21-
run: git pull
22-
- name: return to master
23-
run: git checkout master
24-
- name: Install leiningen
25-
run: wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein && chmod +x lein && sudo mv lein /usr/local/bin/lein
26-
- name: Install dependencies
27-
run: lein deps
28-
- name: Build site
29-
run: ./build.sh https://sourceless.org
30-
- name: git reset www
31-
run: git reset www
32-
- name: delete non-dist folders
33-
run: ls | grep -v dist | xargs rm -r
34-
- name: pull contents out of dist
35-
run: cp -r dist/* .
36-
- name: delete unused stuff
37-
run: |
38-
rm -r dist
39-
rm -r .github
40-
- name: git add .
41-
run: git add .
42-
- name: checkout www
43-
run: git checkout www
44-
- name: git status
45-
run: git status
46-
- name: Set git user
47-
run: |
48-
git config --local user.email "bot@sourceless.org"
49-
git config --local user.name "Site Builder Bot"
50-
- name: commit
51-
run: git commit -m "www-build-$GITHUB_RUN_NUMBER"
52-
- name: Push changes
53-
uses: ad-m/github-push-action@master
54-
with:
55-
github_token: ${{ secrets.GITHUB_TOKEN }}
56-
branch: www
35+
- name: Deploy to GitHub Pages
36+
id: deployment
37+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
1-
/target
2-
/classes
3-
/checkouts
4-
profiles.clj
5-
pom.xml
6-
pom.xml.asc
7-
*.jar
8-
*.class
9-
/.lein-*
10-
/.nrepl-port
11-
/.prepl-port
12-
.hgignore
13-
.hg/
14-
dist/
1+
_site/
2+
.jekyll-cache/
3+
.jekyll-metadata
4+
.bundle/
5+
vendor/
6+
Gemfile.lock

CHANGELOG.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
source "https://rubygems.org"
2+
gem "github-pages", group: :jekyll_plugins

README.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
1-
# site-generator
1+
# sourceless.org
22

3-
My very own crappy site generator!
3+
Personal blog built with Jekyll, hosted on GitHub Pages.
44

5-
## Planned features
5+
## Local development
66

7-
* Light mode (already has dark mode!)
8-
* Accessibility upgrades
9-
* Lots of refactoring
10-
* Template inheritance (if I can figure out classpath issues with Selmer)
7+
```bash
8+
bundle install
9+
bundle exec jekyll serve
10+
```
1111

12-
## Installation
13-
14-
* Install [leiningen](https://leiningen.org/)
15-
* `lein deps`
16-
17-
## Usage
18-
19-
* `build.sh`
20-
* look in the `dist` dir
12+
Then visit http://localhost:4000
2113

2214
## License
2315

_config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
title: Sourceless
2+
url: "https://sourceless.org"
3+
baseurl: ""
4+
permalink: /posts/:title.html
5+
markdown: kramdown
6+
future: true
7+
8+
exclude:
9+
- Gemfile
10+
- Gemfile.lock
11+
- README.md

_layouts/default.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
3+
<html>
4+
<head>
5+
<title>{% if page.title %}Sourceless - {{ page.title }}{% else %}Sourceless{% endif %}</title>
6+
<meta name="description" content="{{ page.summary | default: '' }}"/>
7+
<meta name="keywords" content="{{ page.tags | join: ', ' }}"/>
8+
<meta charset="utf-8"/>
9+
<meta name="author" content="Laurence Pakenham-Smith"/>
10+
<meta name="copyright" content="2020-{{ 'now' | date: '%Y' }} Laurence Pakenham-Smith"/>
11+
<meta name="robots" content="index"/>
12+
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
13+
<link rel="stylesheet" type="text/css" href="{{ '/assets/css/main.css' | relative_url }}"/>
14+
</head>
15+
16+
<body>
17+
<code id="content">
18+
<h1>sourceless</h1>
19+
20+
<a href="{{ '/' | relative_url }}">index</a>
21+
{% assign sorted_pages = site.pages | where_exp: "p", "p.nav_order" | sort: "nav_order" %}
22+
{% for p in sorted_pages %}
23+
<a href="{{ p.url | relative_url }}">{{ p.title }}</a>
24+
{% endfor %}
25+
26+
{{ content }}
27+
</code>
28+
</body>
29+
</html>

_layouts/home.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
layout: default
3+
---
4+
<br/>
5+
<br/>
6+
<br/>
7+
{% for post in site.posts %}
8+
{{ post.date | date: "%Y-%m-%d" }} <a href="{{ post.url | relative_url }}">{{ post.title }}</a><br />
9+
{% endfor %}

_layouts/page.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
layout: default
3+
---
4+
{{ content }}

_layouts/post.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
layout: default
3+
---
4+
{{ content }}
5+
<br/>
6+
Posted {{ page.date | date: "%Y-%m-%d" }}
7+
<br/>
8+
<br/>
9+
{% if page.previous %}
10+
<a href="{{ page.previous.url | relative_url }}">&larr; {{ page.previous.title }}</a>
11+
{% endif %}
12+
{% if page.next %}
13+
<a href="{{ page.next.url | relative_url }}">{{ page.next.title }} &rarr;</a>
14+
{% endif %}

0 commit comments

Comments
 (0)