HugoBlox / hugo-blox-builder

🚨 GROW YOUR AUDIENCE WITH HUGOBLOX! 🚀 HugoBlox is an easy, fast no-code website builder for researchers, entrepreneurs, data scientists, and developers. Build stunning sites in minutes. 适合研究人员、企业家、数据科学家和开发者的简单快速无代码网站构建器。用拖放功能、可定制模板和内置SEO工具快速创建精美网站!
https://hugoblox.com/templates/
MIT License
8.36k stars 2.9k forks source link

`cite` short code usage in the documentation causing an error #3104

Closed Cyfine closed 4 months ago

Cyfine commented 5 months ago

Preliminary Checks

Description

Description:

According to the documentation, the cite shortcode should be used as follows:

{{< cite page="/publication/preprint" view="citation" >}}

However, using the shortcode in this way causes a Hugo error:

shortcode "cite": failed to process shortcode: [1;36m"/hugo-blox-builder/modules/blox-bootstrap/v5@v5.9.8-0.20240513193311-41bd113535e8/layouts/shortcodes/cite.html:19:52"[0m: execute of template failed at <int $view>: error calling int: unable to cast "citation" of type string to int64

To address this issue, the view parameter should be set to the corresponding integer value instead of the string "citation":

{{< cite page="/publication/preprint" view="1" >}}

This should resolve the error and allow the cite shortcode to function as expected.

Suggested Resolution:

Update the documentation to reflect the correct usage of the cite shortcode, where the view parameter should be set to the corresponding integer value, rather than a string.

Reproduction Link

https://github.com/HugoBlox/theme-research-group

Steps to Reproduce

  1. Use following version of hugo blox builder
    /hugo-blox-builder/modules/blox-bootstrap/v5@v5.9.8-0.20240513193311-41bd113535e8/layouts/shortcodes/cite.html:19:52 
  2. use cite short code as in the description

Expected Result

Works like a charm.

Actual Result

Oops, Hugo throws an error:

shortcode "cite": failed to process shortcode: [1;36m"/hugo-blox-builder/modules/blox-bootstrap/v5@v5.9.8-0.20240513193311-41bd113535e8/layouts/shortcodes/cite.html:19:52"[0m: execute of template failed at <int $view>: error calling int: unable to cast "citation" of type string to int64

What Hugo Module versions does your site use?

module github.com/wowchemy/starter-hugo-research-group

go 1.15

require ( github.com/HugoBlox/hugo-blox-builder/modules/blox-bootstrap/v5 v5.9.8-0.20240513193311-41bd113535e8 github.com/HugoBlox/hugo-blox-builder/modules/blox-plugin-decap-cms v0.1.2-0.20231108143325-448ed0e3bd2b github.com/HugoBlox/hugo-blox-builder/modules/blox-plugin-netlify v1.1.2-0.20240509231741-c3d23d929bc6 )

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Chrome

Which Hugo Blox template are you using?

Research Group

What version of Hugo are you using?

hugo v0.126.1+extended darwin/arm64

github-actions[bot] commented 4 months ago

This issue is stale because it has not had any recent activity. The resources of the project maintainers are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the main branch, consider contributing a Pull Request with a fix.

If this is a feature request, and you feel that it is still relevant and valuable, consider contributing a Pull Request for review.

This issue will automatically close soon if no further activity occurs. Thank you for your contributions.