-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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 hugo.BuildCount #13085
Comments
For the use case described in the forum, isn't it sufficient to check the ordinal? |
The ordinal for the first |
... if I remember the ordinal logic correctly: {{< foo >}} // 0
{{< bar >}} // 1
{{< foo >}} // 2 |
For some reason I thought that number was tracked separately for each shortcode, and our (my) docs on the subject need some adjustment: |
I guess we could possibly change that logic, which would make this issue go away.... Edit: I guess it would not make this go away for nested shortcodes. |
The forum topic related to this issue was handled with the |
I have an image gallery shortcode where the details data is stored in a .json file (to be lazy-loaded) and the page position of the shortcode is used for the mapping.
|
See https://discourse.gohugo.io/t/how-should-i-store-dynamic-data-in-the-page-object-hugo-serve-w/52514/2
Deprecating Page.Scratch was the right thing to do, but the example above may be a rare useful example of the old behavior.
It would be simple to add a
hugo.BuildCount
method (I guess starting at 1).In the topic above, you could possibly do:
/cc @jmooring
The text was updated successfully, but these errors were encountered: