You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is not a question, feature request, or anything other than a bug report directly related to Hugo Blox Builder. Please post those things on Discord: https://discord.gg/z8wNYzb
Description
Line 20 of modules/blox-bootstrap/layouts/partials/blocks/portfolio.html reads:
Shouldn't this rather be default 0 (int $block.content.default_button_index)?
According to the Hugo docsdefault "[r]eturns the second argument if set, else the first argument". Also:
When the second argument is the boolean false value, the default function returns false. All other falsy values are considered unset.
The falsy values are false, 0, any nil pointer or interface value, any array, slice, map, or string of length zero, and zero time.Time values.
So as it's currently written, default always returns int $block.content.default_button_index. This doesn't seem intended to me.
Preliminary Checks
Description
Line 20 of
modules/blox-bootstrap/layouts/partials/blocks/portfolio.html
reads:Shouldn't this rather be
default 0 (int $block.content.default_button_index)
?According to the Hugo docs
default
"[r]eturns the second argument if set, else the first argument". Also:So as it's currently written,
default
always returnsint $block.content.default_button_index
. This doesn't seem intended to me.Reproduction Link
hugo-blox-builder/modules/blox-bootstrap/layouts/partials/blocks/portfolio.html
Line 20 in 4f621df
Steps to Reproduce
To be fair, I didn't try to reproduce locally, since this seems clear-cut.
Expected Result
If
$block.content.default_button_index
is unset, use0
, otherwise use the set value.Actual Result
$block.content.default_button_index
is always usedWhat Hugo Module versions does your site use?
Same modules from research-group theme
What operating system(s) are you seeing the problem on?
Windows, macOS, Android, iOS, Linux
What browser(s) are you seeing the problem on?
Chrome, Safari, Firefox, Microsoft Edge, Other
Which Hugo Blox template are you using?
Research Group
What version of Hugo are you using?
0.125.7
The text was updated successfully, but these errors were encountered: