From 76a42a9cea48ee1713b5b0318b09f9bd0bcba0cd Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 8 May 2026 17:54:15 +0200 Subject: fix: guard against double JS execution and fix partial page context Co-Authored-By: Claude Sonnet 4.6 --- layouts/partials/contribution-graph.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'layouts/partials/contribution-graph.html') diff --git a/layouts/partials/contribution-graph.html b/layouts/partials/contribution-graph.html index 5dde2b4..dc95811 100644 --- a/layouts/partials/contribution-graph.html +++ b/layouts/partials/contribution-graph.html @@ -1,5 +1,6 @@ {{- $cellSize := .cellSize | default 8 -}} -{{- $lang := .page.Lang | default "en" -}} +{{- $page := .page -}} +{{- $lang := $page.Lang | default "en" -}} {{- $label := i18n "contrib_widget_label" -}} {{- $heading := i18n "contrib_heading" -}} @@ -15,5 +16,8 @@ > -{{- $js := resources.Get "js/contribution-graph.js" | minify -}} - +{{- 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 -}} + +{{- end -}} -- cgit v1.2.3