perlun / perlun.eu.org

Personal blog site
http://perlun.eu.org
0 stars 0 forks source link

Consider converting this site to use sitegen #26

Closed perlun closed 2 days ago

perlun commented 3 years ago

sitegen is being successfully used in production for https://halleluja.nu since https://github.com/perlun/halleluja.nu/pull/41 was merged last year. The next step would be to use it for this web site as well. It will likely be non-trivial, but I think the easiest way is to try and make a 1-to-1 conversion. Something like this:

Steps involved

I don't know if this is feasible or not, but I don't really see any major reasons for why it would not be. The hardest part is likely the Markdown conversion of blog posts. Markdown is not a uniform format; there are slight deviations in how different parsers deal with it.

perlun commented 6 months ago

Maintaining this project with Jekyll can be painful sometimes, as described in https://github.com/perlun/perlun.eu.org/pull/40#issuecomment-1358077908 and https://github.com/perlun/perlun.eu.org/pull/40#issuecomment-1358092687. The commit message in https://github.com/perlun/perlun.eu.org/commit/81254d8116a105cacb7ad7e84f36dfbd25be3a05 also has lots more details. Including it here for reference:

There is an annoying problem here:

  • The site depends on pygments.rb
  • Pygments.rb in turn, communicates with a Python process using a pipe (reading and writing to stdin/stdout from Python running as a child process)
  • The version of Pygments.rb we use (?) do not work with Python 3. Only Python 2 works.

Ubuntu 22.04 uses Python 3 by default (and this is perhaps the case with Ubuntu 20.04 also), which causes errors like the one seen in https://github.com/perlun/perlun.eu.org/actions/runs/5913115348/job/16037183000. Copying it here into the git commit log, since Github Actions logs are unfortunately not retained forever.

bundle exec jekyll build
      Deprecation: The 'gems' configuration option has been renamed to 'plugins'. Please update your config file accordingly.
Configuration file: /home/runner/work/perlun.eu.org/perlun.eu.org/_config.yml
           Source: /home/runner/work/perlun.eu.org/perlun.eu.org
      Destination: /home/runner/work/perlun.eu.org/perlun.eu.org/_site
Incremental build: disabled. Enable with --incremental
     Generating...
Building site for default language: "xx" to: /home/runner/work/perlun.eu.org/perlun.eu.org/_site
Building site for language: "sv" to: /home/runner/work/perlun.eu.org/perlun.eu.org/_site/sv
Loading translation from file /home/runner/work/perlun.eu.org/perlun.eu.org/_i18n/sv.yml
Building site for language: "en" to: /home/runner/work/perlun.eu.org/perlun.eu.org/_site/en
  Conversion error: Jekyll::Converters::Markdown encountered an error while converting '_i18n/en/_posts/2017-03-17-new-features-in-c-sharp-6-0-and-7-0.md':
                    No header received back.
jekyll 3.9.2 | Error:  No header received back.
perlun commented 6 months ago

Let's aim for using a supported version of Ruby instead (our current Ruby 2.6 is EOL). Ruby 3.3 was released on December 25th, 2023. It is supported for about three more years. If we switch to this version now, we should not need to maintain the Ruby version we use so much for the next few years.

As for Pygments.rb, we'll need to find a way to make it work on Python 3.x, but let's create a separate issue for that. Otherwise we'll have big problems next year, when Ubuntu 20.04 goes EOL (which drops Python 2.7 support, I think).

perlun commented 2 days ago

This issue comment also has more details about me starting to hesitate regarding this change: https://github.com/perlun/perlun.eu.org/pull/40#issuecomment-1879584233. Let's close it now that #37 has been merged. We are on a good, stable Ruby version and we should be able to handle security issues that might arise much easier now going forward. :tada: