I’m hoping to be able to create a system where I can add a snippet (an “event”) in one place and have it show up on multiple pages. On top of that, I’d like to be able to define events in my root module and in each of my leaf modules (that import the base module) and have them all merged.
So, something like this layout:
./my-hugo/
root/
assets/
events.yml
leafA/
assets/
events-A.yml
leafB/
assets/
events-B.yml
Then have a partial that uses transform.Unmarshal to load all the arrays of events in each yaml file into one slice, sort it, and then I can render a timeline page that has additional different events when building leafA and leafB.
At first I tried using resources.GetMatch "events*”, but I had failed to notice that it just retrieves the first match. I think I can do everything I want except find and range over all the different events files. Is there any way to do that that I might be missing?