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

major/minor/patch not assigned correctly #258

Closed
chizmw opened this issue Feb 10, 2021 · 2 comments
Closed

major/minor/patch not assigned correctly #258

chizmw opened this issue Feb 10, 2021 · 2 comments

Comments

@chizmw
Copy link

chizmw commented Feb 10, 2021

I'm attempting to debug an issue with the/my page based on the welcome layout.

I noticed a lot of code checking major and minor but when debugging I found those values were blank.

I discovered where this is set (_layout/base.html) and I believe there are two issues here:

  1. the result of split is assigned to version, but the next steps rely on v[x]
  2. the values when correctly parsed are strings, not ints.

I believe you need to replace:

{% assign version = jekyll.version | split:'.' %}
{% assign major = v[0] %}
{% assign minor = v[1] %}
{% assign patch = v[2] %}

with

{% assign splitv = jekyll.version | split:'.' %}
{% assign major = splitv[0] |plus: 0 %}
{% assign minor = splitv[1] |plus: 0 %}
{% assign patch = splitv[2] |plus: 0 %}

Looking into things a little further, I don't think the scope of assign propagates outside base.html so

base -> about -> welcome

which is trying to make use of major/minor/patch is essentially working with null values and alwys falling through to the else condition.

Ref: jekyll/jekyll#4370

I believe the version splitting serves no purpose in base.html and should be corrected and moved to welcome.html (the only place I've seen it used after a cursory search)

@qwtel
Copy link
Member

qwtel commented Feb 11, 2021

Thanks for doing all this research.

@qwtel
Copy link
Member

qwtel commented Feb 11, 2021

Fixed in 9.1.2, now uploaded to Gumroad

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

No branches or pull requests

2 participants