You probably have a page using the same layout that does not have those .Resources, which means that the .GetMatch would return a nil.
As fooSec is a test section, there’s only fooPost in it, and the partial template resides in layout/partial/fooSec/, so it is applied only to pages in that section, hence I am sure your suggested case does not exist in my scenario here
I suggest wrapping in a with :
Wrapping in a with clause will check nill first, thus “remove” the error notice from hugo, but still not resolving the problem (or explaining the reason) of .Resources.GetMatch not recognizing my files.
@pointyfar, thanks again. Taking your advice and I try to build up a skeleton mockup site to showcase my code, and in the process I find out where the problem is:
I was actually calling the partial from inside the list page template for fooSec, and that’s why .Resources.GetMatch found nothing about my.css and my.js, which should be accessed from fooSec’s single page template.