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.12k stars 2.89k forks source link

RelPermalink instead of Permalink for background image in block v2 #2975

Closed ladychb closed 1 year ago

ladychb commented 1 year ago

Preliminary Checks

Description

In parse_block_v2, currently in line 50: https://github.com/wowchemy/wowchemy-hugo-themes/blob/15ee0927a7f315b7d05d5eedc26911527cf01fe3/modules/wowchemy/layouts/partials/functions/parse_block_v2.html#L50

the code line says: {{ $style_bg = printf "%sbackground-image: url('%s');" $style_bg $bg_img.Permalink }}

It should be RelPermalink instead of Permalink.

For GitHub organizations with more than repository with different custom domains, Permalink does not resolve correctly as it links to the GitHub organization url but not the custom domain relink.

Reproduction Link

https://github.com/chbeu/chbnet.github.io

Steps to Reproduce

already corrected in this repository:

use a background image in block_v2.

e.g., in this example:

Expected Result

the url of the first bg-image is resolved as: url(/media/top/8755_hub69d488ded179fe2d79c316e7804705e_9279888_1920x1920_fit_q95_h2_lanczos.webp)

Actual Result

without change from Permalink to RelPermalink, the bg-image is resolved as: url(https://chbeu.github.io/media/top/8755_hub69d488ded179fe2d79c316e7804705e_9279888_1920x1920_fit_q95_h2_lanczos.webp)

What Hugo Module versions does your site use?

module github.com/chbeu/chbnet.github.io

go 1.20

require ( github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-netlify v1.0.1-0.20230807174326-15ee0927a7f3 github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-netlify-cms v1.0.1-0.20230807174326-15ee0927a7f3 github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-reveal v0.0.0-20221029143146-ff4b7b1193fa github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy/v5 v5.8.0 )

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

macOS

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

Chrome, Safari

Which Wowchemy template are you using?

https://github.com/wowchemy/hugo-minimal-theme

What version of Hugo are you using?

hugo extended v0.117.0

gcushen commented 1 year ago

Have you seen the comments in the code - it's purposely using Permalink as that is what was advised by the creator of Hugo:

https://github.com/wowchemy/wowchemy-hugo-themes/blob/15ee0927a7f315b7d05d5eedc26911527cf01fe3/modules/wowchemy/layouts/partials/functions/parse_block_v2.html#L43

If you think there's an issue with Permalink and GitHub, the best place to raise the issue is in the Hugo repo: https://github.com/gohugoio/hugo/issues/new/choose