The template system allows for very granular control of how individual parts will be merged, overwritten, or reordered.
On top of the Overriding you can do with the presets alone templates have another superpower and that is automatically joining of parts.
It is generally preferred to use
Joining Blocks before overriding.
Often you will want to load some more fonts or an additional CSS file. You can do so by adding a file to the head Joining Block.
<link rel="stylesheet" href="/_merged_assets/additional-styles.css" />
This will add the html at the bottom of the head.
For executing a script you can use the
bottom Joining Block.
<script> console.log('hello world'); </script>
If you look into
docs/_merged_includes/_joiningBlocks/bottom/ you will see a few scripts
In the html
<head> order is usually not that important but when adding script it does.
If you look into the dom then you see that its order matches with the file system order.
Now if you want to move your script in-between
service-worker-update then you can rename your file to
which brings the order to
For more details please see the Joining Blocks Docs