add site-wide JS caching through import maps

This commit is contained in:
りき萌 2024-07-19 20:05:17 +02:00
parent f3aee8f41a
commit 10ccb250c1
15 changed files with 169 additions and 48 deletions

View file

@ -4,12 +4,15 @@
extracting them way more painful than it needs to be. --}}
{{#each page.styles}}
<link rel="stylesheet" href="{{ ../config.site }}/static/css/{{ this }}">
<link rel="stylesheet" href="{{ asset (cat 'css/' this) }}">
{{/each}}
{{#each page.scripts}}
<script type="module" src="{{ ../config.site }}/static/js/{{ this }}"></script>
{{/each}}
<script type="module">
{{!-- Go through the import map for each script. --}}
{{#each page.scripts}}
import "{{ this }}";
{{/each}}
</script>
{{{ page.tree }}}
</main>