summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-05-08 17:55:53 +0200
committerDanilo M. <danix@danix.xyz>2026-05-08 17:55:53 +0200
commit7e4df08766d0f4101e1ec714ddaf59830f35bdf6 (patch)
tree7a4868a71e17013c1452c9927409bd349c373358
parent76a42a9cea48ee1713b5b0318b09f9bd0bcba0cd (diff)
downloaddanixxyz-theme-7e4df08766d0f4101e1ec714ddaf59830f35bdf6.tar.gz
danixxyz-theme-7e4df08766d0f4101e1ec714ddaf59830f35bdf6.zip
fix: move contribution-graph script to baseof, remove from partial
Partial caching prevented Scratch-based deduplication. Script now loaded once from baseof.html; JS guard prevents double-init. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-rw-r--r--layouts/_default/baseof.html4
-rw-r--r--layouts/partials/contribution-graph.html5
2 files changed, 4 insertions, 5 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index aa89a69..3736a9f 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -133,5 +133,9 @@
<!-- Tag cloud spiral layout -->
{{ $tagCloudScript := resources.Get "js/tag-cloud-spiral.js" | minify }}
<script src="{{ $tagCloudScript.RelPermalink }}"></script>
+
+ <!-- Contribution graph widget -->
+ {{ $contribScript := resources.Get "js/contribution-graph.js" | minify }}
+ <script src="{{ $contribScript.RelPermalink }}"></script>
</body>
</html>
diff --git a/layouts/partials/contribution-graph.html b/layouts/partials/contribution-graph.html
index dc95811..41cbc90 100644
--- a/layouts/partials/contribution-graph.html
+++ b/layouts/partials/contribution-graph.html
@@ -16,8 +16,3 @@
></div>
</div>
-{{- if not ($page.Scratch.Get "contrib-graph-js-loaded") -}}
- {{- $page.Scratch.Set "contrib-graph-js-loaded" true -}}
- {{- $js := resources.Get "js/contribution-graph.js" | minify -}}
- <script src="{{ $js.RelPermalink }}"></script>
-{{- end -}}