Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider converting this site to use sitegen #26

Closed
perlun opened this issue Jun 26, 2021 · 3 comments
Closed

Consider converting this site to use sitegen #26

perlun opened this issue Jun 26, 2021 · 3 comments

Comments

@perlun
Copy link
Owner

perlun commented Jun 26, 2021

sitegen is being successfully used in production for https://halleluja.nu since perlun/halleluja.nu#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

  • Write new Handlebars templates to use with sitegen
  • Build the site with Jekyll
  • Build the project with sitegen
  • Ensure the files in the target folder are identical to the ones built with Jekyll (with possible exception for whitespace differences)
  • If not, make further changes to the Handlebars templates or to the sitegen core itself
  • Iterate until the diff is empty

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 perlun changed the title Convert site to use sitegen Consider converting this site to use sitegen Jan 6, 2024
@perlun
Copy link
Owner Author

perlun commented Jan 6, 2024

Maintaining this project with Jekyll can be painful sometimes, as described in #40 (comment) and #40 (comment). The commit message in 81254d8 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
Copy link
Owner Author

perlun commented Jan 6, 2024

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
Copy link
Owner Author

perlun commented Jul 27, 2024

This issue comment also has more details about me starting to hesitate regarding this change: #40 (comment). 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. 🎉

@perlun perlun closed this as completed Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant