-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Exactly the project I needed. Though it seems like the directory structure of the source folder (in your example resources/config/* is flattened after processing and isn't respecting the original structure.
This is highly undesirable for my use case where I have a templates folder that contains a dozen sub-folders organized by type and section. A "preserve structure" option would solve this for me.
But maybe more pressing – my templates directory doesn't need to be moved anywhere. Everything that needs to be parsed is already in the location where it belongs.
This presents a problem when the tags used to indicate which strings need to be appended are overwritten in the appending :)
But Iif the delimiter tags were comments instead of template tags, then query strings that needed updating could always be located and updated/amended, and could also be parsed in place (without relocation).
So for example... instead of
<square70x70logo src="{{/images/logo70.png}}" />
Something like...
<!-- % -->
<square70x70logo src="/images/logo70.png?" />
<!-- % -->
...where your code is only scanning within any open and closing <!-- % --> for href and src – and then finally the ? at the end...updating it according to the manifest.
Even better, after the first run you can update the comment with a time stamp.
<!-- ## Last updated 12.02.21 ## -->
<square70x70logo src="/images/logo70.png?" />
<!-- #### -->
There are probably better ways to tackle it, but you get the idea. Could also be done with comment tags that don't end up in your html.
{{% <square70x70logo src="/images/logo70.png?" /> %}}
So an option for defining the comment or bracket style, together with a requirement and understanding that a ? needs to be at the end of your src or href for the initial parse, and that would do it.
Not easy, I know! But it would be much more broadly usable I think if you can pull it off.