middleman / middleman-blog

Blog Engine Extension for Middleman
https://middlemanapp.com
MIT License
325 stars 179 forks source link

YAML error on Ruby 3.1.0 #383

Closed mockdeep closed 7 months ago

mockdeep commented 2 years ago

Expected behaviour

Everything works with no issues.

Actual behaviour

I'm seeing warnings about the date: key when parsing the blog posts:

YAML Exception parsing [PROJECT_PATH]/boon-blog/source/articles/2014-09-23-setting-up-a-middleman-blog.html.md: Tried to load unspecified class: Date

The frontmatter looks like:

---
title: Setting up a Middleman Blog
date: 2014-09-23
tags: technical, blogging, middleman
authors: Robert Fletcher
---

For some reason, the rendered result of this is that the blog posts show up without their titles.

Steps to reproduce the problem

You can run middleman serve on this branch.

Additional information

tdreyno commented 2 years ago

I would recommend keeping Middleman 4.x projects on Ruby 2.x

There are some PRs to enable Ruby 3.1 support, but those are on the Middleman 5.x branch and unlikely to be backported.

mockdeep commented 2 years ago

@tdreyno I see, do you know when 5.x will be released?

tdreyno commented 2 years ago

Looking a lot like never, but the master branch is up to date and being updated to current releases just in case.

puyo commented 2 years ago

@tdreyno Should I be making plans to move to a different static site generator?

lyc4n commented 2 years ago

I was able to get around this by adding the time to the date.

tdreyno commented 2 years ago

There is no reason to be using Ruby 3.x with Middleman. I suggest utilizing rvm or Docker to allow Middleman v4 to continue to operate in the environment it expects.

markets commented 7 months ago

@mockdeep @puyo @lyc4n We finally pushed some fixes in v4 branch (now "main" branch again) and now it works fine with all these Ruby versions (From 2.5 to 3.3): https://github.com/middleman/middleman/blob/1d1e7528d16dad59a15e988ea5aed171c79a7736/.github/workflows/ci.yml#L12

So I think you can close this issue 🙏🏼