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

String functions within render hooks see HAHAHUGOSHORTCODE #7416

Open
jmooring opened this issue Jun 21, 2020 · 4 comments
Open

String functions within render hooks see HAHAHUGOSHORTCODE #7416

jmooring opened this issue Jun 21, 2020 · 4 comments
Milestone

Comments

@jmooring
Copy link
Member

jmooring commented Jun 21, 2020

What version of Hugo are you using (hugo version)?

$ hugo version
Hugo Static Site Generator v0.73.0-DEV/extended linux/amd64 BuildDate: unknown

Does this issue reproduce with the latest release?

Yes

To Reproduce

git clone --single-branch -b hugo-github-issue-7416 https://github.com/jmooring/hugo-testing hugo-github-issue-7416
cd hugo-github-issue-7416
hugo server

Then visit http:https://localhost:1313/post/test/.

Description

Content page contains the following markdown:

[Other Page]({{< relref "0123456789abcdef.md" >}})

layouts/_default/_markup/render-link.html contains this code:

{{ substr .Destination 0 16 }}

This renders:

HAHAHUGOSHORTCOD

Other

Reported in https://discourse.gohugo.io/t/render-link-functionality-not-working/26358/.

@bep
Copy link
Member

bep commented Jun 21, 2020

The long story short:

You need to use the {{% delimiter in this case.

@jmooring
Copy link
Member Author

Shall I close this as a documentation issue, and submit a documentation PR, or should it be addressed in code?

@bep bep added this to the v0.73 milestone Jun 21, 2020
@bep
Copy link
Member

bep commented Jun 21, 2020

I guess it's both. The best thing to do on the "code side" is to raise an error, I suspect.

@bep bep modified the milestones: v0.73, v0.74 Jun 23, 2020
@jmooring
Copy link
Member Author

A Google search shows that "HAHAHUGOSHORTCODE" is visible on several live sites. For example:

1) https://developer.servicenow.com/blog.do?p=/categories/now-creator/

image

2) https://www.juliabloggers.com/author/julia-on/

image

We're going to add this to the list of strings that we grep for prior to deployment, but I suspect that's a quality control step that most do not or will not perform.

@bep bep modified the milestones: v0.74, v0.75 Jul 13, 2020
@bep bep modified the milestones: v0.75, v0.76 Sep 14, 2020
@bep bep modified the milestones: v0.76, v0.77 Oct 6, 2020
@bep bep modified the milestones: v0.77, v0.78 Oct 30, 2020
@bep bep modified the milestones: v0.78, v0.83 Apr 23, 2021
@bep bep modified the milestones: v0.83, v0.84 May 3, 2021
@bep bep modified the milestones: v0.84, v0.85 Jun 18, 2021
@bep bep modified the milestones: v0.85, v0.86 Jul 5, 2021
@bep bep modified the milestones: v0.86, v0.87, v0.88 Jul 26, 2021
@bep bep modified the milestones: v0.88, v0.89 Sep 2, 2021
@bep bep modified the milestones: v0.116.0, v0.117.0 Aug 1, 2023
@bep bep modified the milestones: v0.117.0, v0.118.0 Aug 30, 2023
@bep bep modified the milestones: v0.118.0, v0.119.0 Sep 15, 2023
@bep bep modified the milestones: v0.119.0, v0.120.0 Oct 4, 2023
@bep bep modified the milestones: v0.120.0, v0.121.0 Oct 31, 2023
@gohugoio gohugoio deleted a comment from ytrepidorosonomous Nov 26, 2023
@bep bep modified the milestones: v0.121.0, v0.122.0 Dec 6, 2023
@bep bep modified the milestones: v0.122.0, v0.123.0, v0.124.0 Jan 27, 2024
@bep bep modified the milestones: v0.124.0, v0.125.0 Mar 4, 2024
@bep bep modified the milestones: v0.125.0, v0.126.0 Apr 23, 2024
@bep bep modified the milestones: v0.126.0, v0.127.0 May 15, 2024
@bep bep modified the milestones: v0.127.0, v0.128.0 Jun 8, 2024
@bep bep modified the milestones: v0.128.0, v0.129.0 Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants