Skip to content

Commit b03209f

Browse files
authored
Merge pull request #117 from makeabilitylab/feat/jekyll4-build-speedup
Upgrade to Jekyll 4, drop github-pages gem (#81)
2 parents 92480ec + 9f50ab1 commit b03209f

3 files changed

Lines changed: 46 additions & 18 deletions

File tree

.github/workflows/jekyll.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ jobs:
4040
- name: Setup Ruby
4141
uses: ruby/setup-ruby@v1
4242
with:
43-
# Matches .ruby-version. bundler-cache installs the Gemfile (still
44-
# the github-pages gem, so the build is byte-for-byte the current
45-
# one) and caches gems between runs.
43+
# Matches .ruby-version. bundler-cache installs the Gemfile (Jekyll 4
44+
# toolchain since issue #81) and caches gems between runs.
4645
ruby-version: "3.3.11"
4746
bundler-cache: true
4847
cache-version: 0

Gemfile

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
11
source "https://rubygems.org"
22

3-
# gem "jekyll"
4-
# gem 'kramdown-parser-gfm'
3+
# These were extracted from the Ruby stdlib in 3.4+; keep them explicit so the
4+
# build works across Ruby versions.
55
gem "csv"
66
gem "bigdecimal"
77
gem "base64"
8-
gem "github-pages", group: :jekyll_plugins
8+
9+
# Jekyll 4 toolchain. We dropped the `github-pages` gem, which hard-pinned
10+
# Jekyll 3.9 (and old liquid/kramdown) and was the main cause of slow builds
11+
# (issue #81). The site now publishes via a full `bundle exec jekyll build` in
12+
# GitHub Actions (issue #98), so the legacy GitHub Pages gem environment is no
13+
# longer required.
14+
gem "jekyll", "~> 4.3"
15+
16+
# Plugins that the github-pages gem used to auto-enable and that this site
17+
# relies on. They must now be declared explicitly (also listed in _config.yml
18+
# `plugins:`).
19+
group :jekyll_plugins do
20+
gem "jekyll-sitemap" # /sitemap.xml
21+
gem "jekyll-relative-links" # rewrites internal .md links -> .html in source
22+
gem "jekyll-include-cache" # just-the-docs uses {% include_cached %}
23+
gem "jekyll-seo-tag" # just-the-docs head dependency
24+
end
25+
926
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
1027
gem "webrick", "~> 1.7"
11-
gem "just-the-docs", "0.12.0"
28+
gem "just-the-docs", "0.12.0"

_config.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
# For technical reasons, this file is *NOT* reloaded automatically when you use
99
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
1010
# remote_theme: pmarsceill/just-the-docs
11-
remote_theme: just-the-docs/just-the-docs@v0.12.0
11+
# Use the locally-installed just-the-docs gem (0.12.0, see Gemfile) instead of
12+
# remote_theme: same theme version, but no network fetch / theme resolution at
13+
# build time. Part of the Jekyll 4 build-speed work (issue #81).
14+
theme: just-the-docs
1215

1316
# Fixed at 0.2.8 because of: https://github.com/makeabilitylab/physcomp/issues/9
1417
# remote_theme: pmarsceill/just-the-docs@v0.2.8
@@ -24,14 +27,17 @@ tagline: Learn Arduino, ESP32, sensors, and more with this open-source interacti
2427
# See: https://jekyllrb.com/docs/configuration/incremental-regeneration/
2528
incremental: true
2629

27-
# Google Gemini suggested I try this to reduce build time, which is often 20 secs
28-
# or longer on my desktop (AMD Ryzen 7 3800X 8-Core Processor 3.90 GHz with 32 GB RAM)
29-
cache: true
30-
31-
# Gemini also suggested I disable search for local builds
32-
# Note: Search is enabled by default (and this follows just-the-docs defaults)
30+
# Search is enabled by default (follows just-the-docs defaults).
3331
search_enabled: true
3432

33+
# Sass (jekyll-sass-converter 3.x / dart-sass under Jekyll 4):
34+
# quiet_deps: silence the @import / darken() deprecation warnings emitted by
35+
# the just-the-docs theme's own SCSS (not our code).
36+
# sourcemap: don't emit .css.map files into _site.
37+
sass:
38+
quiet_deps: true
39+
sourcemap: never
40+
3541
# site.url: https://jonfroehlich.github.io/physcomp
3642
# Make absolute paths work with GitHub pages
3743
# See: https://stackoverflow.com/a/19173888/388117
@@ -42,12 +48,18 @@ url: "https://makeabilitylab.github.io" # the base hostname & protocol for your
4248
# For copy button on code
4349
enable_copy_code_button: true
4450

45-
# Jekyll plugins. jekyll-sitemap generates /sitemap.xml (submittable to search
46-
# engines) to help indexing. It ships with the github-pages gem and is on the
47-
# GitHub Pages plugin whitelist, so it works under both the legacy build and the
48-
# GitHub Actions build (#98).
51+
# Jekyll plugins. These were previously auto-enabled by the github-pages gem;
52+
# after moving to Jekyll 4 (issue #81) they are declared explicitly here and in
53+
# the Gemfile's :jekyll_plugins group.
54+
# jekyll-sitemap -> /sitemap.xml (submittable to search engines)
55+
# jekyll-relative-links -> rewrites internal .md links to .html
56+
# jekyll-include-cache -> just-the-docs uses {% include_cached %}
57+
# jekyll-seo-tag -> just-the-docs head dependency
4958
plugins:
5059
- jekyll-sitemap
60+
- jekyll-relative-links
61+
- jekyll-include-cache
62+
- jekyll-seo-tag
5163

5264
# custom site variables
5365
arduino_github_baseurl: "https://makeabilitylab.github.io/physcomp/"

0 commit comments

Comments
 (0)