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

Clarify the distinction between resources and .Resources #1548

Closed
wants to merge 1 commit into from

Conversation

PaulSD
Copy link

@PaulSD PaulSD commented Oct 17, 2021

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.

@jmooring
Copy link
Member

I think that "global" is probably a better descriptor:

  • Global resource vs page resource
  • Global asset vs page asset

@PaulSD
Copy link
Author

PaulSD commented Oct 17, 2021

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...

@bep
Copy link
Member

bep commented Oct 17, 2021

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.

  • site and .Site is global vs. page, but they point to the same object
  • resources and .Resources are two different collections.

@PaulSD
Copy link
Author

PaulSD commented Oct 17, 2021

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. :)

@lschierer
Copy link

I would love to see this merged in. I'm currently struggling with exactly this distinction.

@jmooring
Copy link
Member

jmooring commented Nov 7, 2023

This will be addressed in #2307

@jmooring jmooring closed this Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants