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

Add variable expansion support in shortcode params #5463

Closed
bep opened this issue Nov 23, 2018 · 7 comments
Closed

Add variable expansion support in shortcode params #5463

bep opened this issue Nov 23, 2018 · 7 comments

Comments

@bep
Copy link
Member

bep commented Nov 23, 2018

See 3) in twbs/bootstrap#24475 (comment)

Not sure how this would look like, but something ala Bash's variable expansion, eg.

{{< relref "${.Site.Params.version}/features" >}}
@bep bep added this to the v0.53 milestone Nov 23, 2018
@moorereason
Copy link
Contributor

Can’t this already be solved by a simple wrapper shortcode? “vref” and “vrelref” for example.

@bep
Copy link
Member Author

bep commented Nov 23, 2018

Can’t this already be solved by a simple wrapper shortcode?

Yes. But it is a fairly common problem, and you it would potentially create lots of "wrapper variants" and make the content "unportable".

I don't think I'm solving this unless I can find a simple and fast way to do it -- but there are obvious and useful use cases for this.

@bep bep modified the milestones: v0.53, v0.54 Dec 6, 2018
@bep bep modified the milestones: v0.54, v0.55 Dec 26, 2018
@jicksta
Copy link

jicksta commented Jan 9, 2019

I think I've been running into a similar issue.

https://github.com/jicksta/repro-hugo-lexer-issue

I'm trying to render a Hugo page from a data file that passes dynamic data into a shortcode as a parameter. Doing something like:

{{< myshortcode $somethingdynamic >}}

actually generates a lexer error at the "$" (or at the . in the case of .somethingdynamic).

Maybe I'm missing something idiomatic about Go / Hugo templating, but shouldn't dynamic data be a supported use-case for shortcodes?

More info can be found in the README of the repo linked above.

Thanks btw for all the great work on Hugo so far!

@bep bep modified the milestones: v0.55, v0.56 Feb 1, 2019
@stale
Copy link

stale bot commented Jun 1, 2019

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Jun 1, 2019
@XhmikosR
Copy link
Contributor

XhmikosR commented Jun 1, 2019

This is still a valid request.

@stale stale bot removed the Stale label Jun 1, 2019
@bep bep modified the milestones: v0.56, v0.57 Jun 14, 2019
@bep bep modified the milestones: v0.57, v0.58 Jul 31, 2019
@bep bep modified the milestones: v0.58, v0.59 Aug 13, 2019
@bep bep modified the milestones: v0.59, v0.60 Sep 6, 2019
@bep bep modified the milestones: v0.60, v0.61 Oct 21, 2019
@bep bep modified the milestones: v0.61, v0.62 Nov 25, 2019
@bep bep modified the milestones: v0.111.0, v0.112.0 Feb 15, 2023
@bep bep modified the milestones: v0.112.0, v0.113.0 Apr 15, 2023
@bep bep modified the milestones: v0.113.0, v0.114.0, v0.115.0 Jun 8, 2023
@bep bep modified the milestones: v0.115.0, v0.116.0 Jun 30, 2023
@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
@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 closed this as completed Jan 31, 2024
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants