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

.Site.Params.contentDir not working anymore #11237

Closed
xoxys opened this issue Jul 11, 2023 · 2 comments
Closed

.Site.Params.contentDir not working anymore #11237

xoxys opened this issue Jul 11, 2023 · 2 comments

Comments

@xoxys
Copy link

xoxys commented Jul 11, 2023

While using .Site.Params.contentDir in a template worked fine in Hugo <= 0.111.3, it no longer works in Hugo 0.112.0 and above. Was this change intended?

@jmooring
Copy link
Member

The contentDir configuration value was inadvertently exposed to the templates < v0.112.0.

To create an "edit this page on GitHub" link you can use:

{{ with .File }}
  {{ strings.TrimPrefix hugo.WorkingDir .Filename }}
{{ end }}

Which gives you something like this:

/content/en/posts/post-1.md

More info:
https://discourse.gohugo.io/t/hugo-v0-112-0-new-template-functions/44512

@github-actions
Copy link

github-actions bot commented Aug 2, 2023

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 Aug 2, 2023
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

2 participants