Skip to content

chore: upgrade Ruby 2.6 -> 3.3 and Jekyll 3.8 -> 4.3#87

Merged
nguquen merged 1 commit into
botbie:masterfrom
botbeech:chore/upgrade-ruby-jekyll
Apr 21, 2026
Merged

chore: upgrade Ruby 2.6 -> 3.3 and Jekyll 3.8 -> 4.3#87
nguquen merged 1 commit into
botbie:masterfrom
botbeech:chore/upgrade-ruby-jekyll

Conversation

@botbeech
Copy link
Copy Markdown
Contributor

Summary

Moves the stack off EOL Ruby 2.6 / Jekyll 3.8 onto a currently maintained baseline. Site source (posts, layouts, includes, custom plugins) is untouched — change set is entirely build/CI/config.

What changes

Component Before After
Ruby 2.6 (EOL 2022-03) 3.3 (pinned via new .ruby-version)
Bundler 1.13.6 in lock / 1.17.3 in CI ships with Ruby 3.3 — no pin
Jekyll 3.8.5 ~> 4.3 (resolves to 4.4.1)
kramdown 1.17 ~> 2.4 + new kramdown-parser-gfm ~> 1.1
rouge 3.3 ~> 4.2
jekyll-feed 0.12 ~> 0.17
jekyll-sitemap 1.3 ~> 1.4
jekyll-paginate 1.1 kept at 1.1 (custom _plugins/ depend on Jekyll::Paginate::Pager)
webrick stdlib added as explicit gem (Ruby 3.0 removed it from stdlib)

Files touched

  • Gemfile, Gemfile.lock (regenerated) — version bumps above.
  • .ruby-version (new) — 3.3.6; ruby/setup-ruby@v1 and local tooling read this.
  • Dockerfileruby:2.6 -> ruby:3.3-slim; drop BUNDLER_VERSION arg (bundler ships with Ruby 3); add build-essential for native gem extensions.
  • docker-compose.yml — drop the stale BUNDLER_VERSION: "1.17.2" build arg.
  • _config.yml — explicit kramdown: { input: GFM, syntax_highlighter: rouge } so tables / strikethrough / fenced code keep working after kramdown 2's GFM split.
  • .github/workflows/pages.yml:
    • Drop the ruby-version: '2.6' + bundler: '1.17.3' pins; ruby/setup-ruby@v1 now reads .ruby-version.
    • Add a new check job on pull_request (no if: guard, no deploy, no artifact upload). Gives PR authors and forks a build smoke test. The existing build + deploy jobs remain guarded with github.repository == 'botbie/blog' and now also github.event_name != 'pull_request' so PRs don't race against the deploy pipeline.

What intentionally does NOT change

  • _plugins/jekyll-paginate-{authors,tags}.rb — both subclass Jekyll::Paginate::Pager and use stable Jekyll::Page / Jekyll::Generator APIs that are unchanged in Jekyll 4.4. No edits needed.
  • _layouts/*, _includes/* — paginator field names (paginator.previous_page, .next_page, .page, .total_pages, .total_posts, .posts) are unchanged between jekyll-paginate 1.1 and Jekyll 4.
  • Post frontmatter, permalinks, URL structure — byte-identical output directory layout.
  • No Sass pipeline changes (the site uses plain CSS — verified).

Local validation

Bundled install + bundle exec jekyll build on Ruby 3.1.2 (via apt, as 3.3 wasn't available in the sandbox image — but all dependency constraints are >= 3.1, so 3.3 on CI runners is a strict superset). Verified:

  • /index.html + /page/2/index.html render.
  • /author/<username>/index.html for every user in _data/authors.yml.
  • /author/<username>/page/N/index.html pagination tails (up to /page/4/ for prolific authors).
  • /tag/<slug>/index.html + /tag/<slug>/page/N/index.html for every tag.
  • A sample post (/2016/06/10/bitcoin-blockchain.html) renders with correct title, description meta, and Vietnamese content preserved.
  • /feed.xml, /sitemap.xml, /CNAME all present.
  • 133 HTML pages + 3 XML files, 19 MB total output.

No errors. One warning (see below).

Known pre-existing issue surfaced

Build now logs:

Conflict: The following destination is shared by multiple files.
          /_site/tag/ctf/index.html
          - _layouts/tag.html
          - _layouts/tag.html

Root cause: _plugins/jekyll-paginate-tags.rb slugifies via tag.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, ''), so the tags "ctf" (2 posts) and "CTF" (1 post) both map to /tag/ctf/. Same pattern affects "WebAssembly", "Java", "String" (capitalized variants with no lowercase collision today, safe so far). This is not introduced by the upgrade — the same logic would have produced the same conflict on Jekyll 3. Worth a follow-up PR (either normalize tags at post-read time, or add a de-dup pass in the generator); not fixing here to keep this PR focused.

Follow-ups (out of scope)

  • Fix the tag case-collision above.
  • Consider migrating _plugins/jekyll-paginate-* to jekyll-paginate-v2 so we can drop the jekyll-paginate 1.x dependency eventually.
  • Enable Dependabot for bundler + github-actions ecosystems now that the floor is modern.

Moves the stack off EOL Ruby 2.6 / Jekyll 3.8 and onto a currently
maintained baseline.

Gem bumps:
  - Ruby      2.6   -> 3.3 (pinned via new .ruby-version)
  - Bundler   1.13  -> ships with Ruby (no pin needed)
  - Jekyll    3.8.5 -> 4.3 series (~> 4.3, resolved 4.4.1)
  - kramdown  1.17  -> 2.x, with new kramdown-parser-gfm gem
  - rouge     3.3   -> 4.x
  - jekyll-feed    0.12 -> 0.17
  - jekyll-sitemap 1.3  -> 1.4
  - jekyll-paginate kept at 1.1 (the custom _plugins/ subclass
    Jekyll::Paginate::Pager and depend on its public API)
  - webrick added (Ruby 3 stdlib no longer ships it; needed for
    `jekyll serve`)

Config:
  - _config.yml now enables the GFM kramdown input explicitly so
    tables/strikethrough/fenced-code continue to work after the
    kramdown 2.x split.

CI (.github/workflows/pages.yml):
  - Drop the 2.6 + bundler 1.17.3 pins; ruby/setup-ruby@v1 now reads
    the new .ruby-version automatically.
  - Add a fork-safe `check` job that runs on pull_request (no deploy
    side effects, no repository guard) so PR authors and forks get
    build feedback. The deploy path (`build` + `deploy` jobs) stays
    restricted to the upstream botbie/blog repo.

Docker:
  - FROM ruby:3.3-slim, drop BUNDLER_VERSION arg (bundler ships with
    Ruby). Install build-essential for native gem extensions.

Validation:
  - bundle install + `bundle exec jekyll build` succeed locally.
  - /author/<name>/, /tag/<slug>/ and their /page/N/ variants all
    render.
  - feed.xml, sitemap.xml, CNAME, and 133 post pages are produced.

Known pre-existing issue surfaced (not caused by this change): the
tag slug function in _plugins/jekyll-paginate-tags.rb downcases, so
posts tagged "CTF" and "ctf" both target /tag/ctf/ and one layout
overwrites the other. Worth a follow-up; unchanged by this upgrade.
@nguquen nguquen merged commit 63a55b0 into botbie:master Apr 21, 2026
3 checks passed
@botbeech botbeech deleted the chore/upgrade-ruby-jekyll branch April 21, 2026 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants