This line: {{ $jsoncabeçalho := .Page.Resources.GetMatch “cabecalho.json” }} is returning me a random resource cabecalho.json from a random bundle, instead of returning always the one local to the page.
Rebuilding the site results in each rebuild fetching the page from a different place, compltetely at random.
What is the correct way to get ONLY the file I want, never others with same name that is in other folders?
I can assure you that it isn’t random. It’s hard to say without seeing the source, but I’m guessing that you load this from a single.html template or something which will be applied to all of your pages.
this is enough to make the table change to one from another random page.
EDIT:
added this code to the page:
{{ range .Page.Resources }}
{{/* The context, ".", is now each one of the pages as it goes through the loop */}}
{{ printf "%#v" .Permalink }}
{{ end }}
The result is that this code always print the correct link to the resource, but the CONTENTS of the resource change every time I close and open the server again.
EDIT 2:
just for reference, the code that loads the content of the resource file: