diff options
| author | Danilo M. <danix@danix.xyz> | 2026-05-08 17:39:07 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-05-08 17:39:29 +0200 |
| commit | a865dcbb69b0541ccdab941eede8c3005dfed9c7 (patch) | |
| tree | 7d9ceec5f417e859e5911f0e3dc593b7471326bc /layouts | |
| parent | 9d5f690b8f98c6e9cf7d54b7279c5097e7a1d3a4 (diff) | |
| download | danixxyz-theme-a865dcbb69b0541ccdab941eede8c3005dfed9c7.tar.gz danixxyz-theme-a865dcbb69b0541ccdab941eede8c3005dfed9c7.zip | |
feat: add contribution graph widget
Sidebar (/is pages, cellSize=8) and footer (sitewide, cellSize=6).
Fetches /contributions.json, split-cell linear-gradient rendering
(gitolite=green/accent2, github=purple/accent), opacity intensity
levels, month labels, tooltip, i18n IT/EN. WCAG 2.1 AA compliant.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/partials/contribution-graph.html | 19 | ||||
| -rw-r--r-- | layouts/partials/footer.html | 3 | ||||
| -rw-r--r-- | layouts/partials/sidebar.html | 5 |
3 files changed, 27 insertions, 0 deletions
diff --git a/layouts/partials/contribution-graph.html b/layouts/partials/contribution-graph.html new file mode 100644 index 0000000..5dde2b4 --- /dev/null +++ b/layouts/partials/contribution-graph.html @@ -0,0 +1,19 @@ +{{- $cellSize := .cellSize | default 8 -}} +{{- $lang := .page.Lang | default "en" -}} +{{- $label := i18n "contrib_widget_label" -}} +{{- $heading := i18n "contrib_heading" -}} + +<div class="sidebar-widget contrib-widget"> + <p class="sidebar-widget-label"># {{ $heading }}</p> + <div + id="contrib-graph-{{ $cellSize }}" + class="contrib-container" + style="display:none" + data-cell-size="{{ $cellSize }}" + data-lang="{{ $lang }}" + data-aria-label="{{ $label }}" + ></div> +</div> + +{{- $js := resources.Get "js/contribution-graph.js" | minify -}} +<script src="{{ $js.RelPermalink }}"></script> diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index aec694b..4287d19 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -68,6 +68,9 @@ <dd class="text-text font-mono text-xs">{{ i18n "footer_about_focus_value" }}</dd> </div> </dl> + <div class="mt-4"> + {{- partial "contribution-graph.html" (dict "cellSize" 6 "page" .) -}} + </div> </div> </div> diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 2047c12..1c3f020 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -62,6 +62,11 @@ </ul> </div> + {{- if and (eq .Section "is") (eq .Kind "section") }} + <hr class="sidebar-hr"> + {{- partial "contribution-graph.html" (dict "cellSize" 8 "page" .) -}} + {{- end }} + <hr class="sidebar-hr"> <!-- Social sharing widget --> |
