mirror of https://github.com/lxndrblz/anatole.git

google-labs-jules[bot]
3 hours ago c0b370a9c98b383a73ad8d3a6635b19367ba2e70
⚡ optimize customJs build time by caching resource get

Co-authored-by: KarelZe <12801659+KarelZe@users.noreply.github.com>
1 files modified
1 files added
3 ■■■■■ changed files
layouts/partials/get-resource.html 1 ●●●●● patch | view | raw | blame | history
layouts/partials/head.html 2 ●●●●● patch | view | raw | blame | history
layouts/partials/get-resource.html
New file
@@ -0,0 +1 @@
{{- return resources.Get . -}}
layouts/partials/head.html
@@ -189,7 +189,7 @@
    {{- if or (in . "http://") (in . "https://") -}}
      <script src="{{ . | relURL }}"></script>
    {{- else -}}
      {{- $customJS := resources.Get . -}}
      {{- $customJS := partialCached "get-resource.html" . . -}}
      {{- if $customJS -}}
        {{- if eq $js "" -}}
          {{- $js = $customJS -}}