chore: upgrade Ruby 2.6 -> 3.3 and Jekyll 3.8 -> 4.3#87
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
.ruby-version)~> 4.3(resolves to 4.4.1)~> 2.4+ newkramdown-parser-gfm ~> 1.1~> 4.2~> 0.17~> 1.4_plugins/depend onJekyll::Paginate::Pager)Files touched
Gemfile,Gemfile.lock(regenerated) — version bumps above..ruby-version(new) —3.3.6;ruby/setup-ruby@v1and local tooling read this.Dockerfile—ruby:2.6->ruby:3.3-slim; dropBUNDLER_VERSIONarg (bundler ships with Ruby 3); addbuild-essentialfor native gem extensions.docker-compose.yml— drop the staleBUNDLER_VERSION: "1.17.2"build arg._config.yml— explicitkramdown: { input: GFM, syntax_highlighter: rouge }so tables / strikethrough / fenced code keep working after kramdown 2's GFM split..github/workflows/pages.yml:ruby-version: '2.6'+bundler: '1.17.3'pins;ruby/setup-ruby@v1now reads.ruby-version.checkjob onpull_request(noif:guard, no deploy, no artifact upload). Gives PR authors and forks a build smoke test. The existingbuild+deployjobs remain guarded withgithub.repository == 'botbie/blog'and now alsogithub.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 subclassJekyll::Paginate::Pagerand use stableJekyll::Page/Jekyll::GeneratorAPIs 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.Local validation
Bundled install +
bundle exec jekyll buildon Ruby 3.1.2 (viaapt, 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.htmlrender./author/<username>/index.htmlfor every user in_data/authors.yml./author/<username>/page/N/index.htmlpagination tails (up to/page/4/for prolific authors)./tag/<slug>/index.html+/tag/<slug>/page/N/index.htmlfor every tag./2016/06/10/bitcoin-blockchain.html) renders with correct title, description meta, and Vietnamese content preserved./feed.xml,/sitemap.xml,/CNAMEall present.No errors. One warning (see below).
Known pre-existing issue surfaced
Build now logs:
Root cause:
_plugins/jekyll-paginate-tags.rbslugifies viatag.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)
_plugins/jekyll-paginate-*tojekyll-paginate-v2so we can drop thejekyll-paginate1.x dependency eventually.bundler+github-actionsecosystems now that the floor is modern.