hugoDocs
hugoDocs copied to clipboard
Clarify the distinction between resources and .Resources
I've seen a number of references/comments that mix up resources.Get and .Resources.GetMatch (for example: https://discourse.gohugo.io/t/data-files-in-the-page-bundle/19284/2). This leads to confusion (for example: https://discourse.gohugo.io/t/what-am-i-not-getting-about-resources-get/33517).
Ideally, resources would have a different name (like assets) to eliminate some of the ambiguity with .Resources. However, since it is probably too late to change the name now, the next best thing would be to have the docs more explicitly distinguish between these.
This PR attempts to clarify the distinction between these in the documentation.
I think that "global" is probably a better descriptor:
- Global resource vs page resource
- Global asset vs page asset
Ok. I've updated my PR to use "global assets" instead of "asset resources".
Is there currently such a thing as a global resource or a page asset? I had thought there were only page resources and global assets...
I agree about the global discussion, but I think an important distinction that I suspect is missing in all of this is that these two resource collections have very much different content.
siteand.Siteis global vs. page, but they point to the same objectresourcesand.Resourcesare two different collections.
Yeah, that is actually most of what I changed in this PR - explicitly pointing out in the docs that resources and .Resources are different things. :)
I would love to see this merged in. I'm currently struggling with exactly this distinction.
This will be addressed in https://github.com/gohugoio/hugoDocs/issues/2307