Thanks for the quick replies.
After some more hack-hackiness, I figured out that my original method of calling resources.* works, specifically resources.ExecuteAsTemplate. I had just messed up the syntax a bit on my first attempts and assumed Hugo couldn’t do it.
For anyone else who wants to do this:
- Put .htaccess in assets folder
- Call resources.ExecuteAsTemplate on the .htaccess file (from anywhere)
- Call .RelPermalink on that resource (from anywhere) so Hugo actually puts it into public. I do this in an HTML comments tag < !-- – >, which I strip out with minify, i.e., it never shows up in source.