Skip to content

Commit

Permalink
use asset directory to avoid conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
HidegonSan committed Nov 25, 2023
1 parent b22dbbe commit de64596
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
10 changes: 8 additions & 2 deletions layouts/partials/footer/instant_page.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{{/* instant.page | Thanks: https://instant.page/ */}}

{{- with resources.Get "js/instantpage.js" | fingerprint -}}
<script defer crossorigin="anonymous" type="module" src="{{- .RelPermalink -}}" integrity="{{- .Data.Integrity -}}"></script>
{{- with slice (resources.Get "js/instantpage.js") | resources.Concat "assets/js/instantpage.min.js" | fingerprint -}}
<script
defer
crossorigin="anonymous"
type="module"
src="{{- .RelPermalink -}}"
integrity="{{- .Data.Integrity -}}"
></script>
{{- end -}}
19 changes: 15 additions & 4 deletions layouts/partials/head/css/chroma_css.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,28 @@
$chroma_tweak
$codeblock_file_name
)
| resources.Concat "css/chroma/chroma_all.css"
| resources.Concat "assets/css/chroma/chroma_all.css"
-}}

{{- with $chroma_css | toCSS | minify | fingerprint -}}
<link href="{{- .RelPermalink -}}" integrity="{{- .Data.Integrity -}}" crossorigin="anonymous" rel="preload stylesheet" as="style">
<link
crossorigin="anonymous"
href="{{- .RelPermalink -}}"
integrity="{{- .Data.Integrity -}}"
rel="preload stylesheet"
as="style">
{{- end -}}

{{/* chroma css for noscript */}}
<noscript>
{{- with resources.Get "css/chroma/chroma_noscript.css" | toCSS | minify | fingerprint -}}
<link href="{{- .RelPermalink -}}" integrity="{{- .Data.Integrity -}}" crossorigin="anonymous" rel="preload stylesheet" as="style">
{{- with slice (resources.Get "css/chroma/chroma_noscript.css") | resources.Concat "assets/css/chroma/chroma_noscript.css" | toCSS | minify | fingerprint -}}
<link
crossorigin="anonymous"
href="{{- .RelPermalink -}}"
integrity="{{- .Data.Integrity -}}"
rel="preload stylesheet"
as="style"
>
{{- end -}}
</noscript>

Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/head/goatcounter.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{- $goatcounter_license_body := "// GoatCounter: https://www.goatcounter.com\n// This file (and *only* this file) is released under the ISC license:\n// https://opensource.org/licenses/ISC\n" -}}
{{- $goatcounter_license := $goatcounter_license_body | resources.FromString "js/goatcounter_license.js" -}}
{{- $goatcounter := (resources.Get "js/goatcounter.js") | minify -}}
{{- $goatcounter_bundled := (slice $goatcounter_license $goatcounter) | resources.Concat "js/goatcounter.js" -}}
{{- $goatcounter_bundled := (slice $goatcounter_license $goatcounter) | resources.Concat "assets/js/goatcounter.min.js" -}}

{{- with $goatcounter_bundled | fingerprint -}}
<script
Expand Down

0 comments on commit de64596

Please sign in to comment.