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:
- the result of
split is assigned to version, but the next steps rely on v[x]
- 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
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)
I'm attempting to debug an issue with the/my page based on the
welcomelayout.I noticed a lot of code checking
majorandminorbut 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:splitis assigned to version, but the next steps rely onv[x]I believe you need to replace:
with
Looking into things a little further, I don't think the scope of
assignpropagates outsidebase.htmlsowhich is trying to make use of major/minor/patch is essentially working with null values and alwys falling through to the
elsecondition.Ref: jekyll/jekyll#4370
I believe the version splitting serves no purpose in
base.htmland should be corrected and moved towelcome.html(the only place I've seen it used after a cursory search)