From f5f8a690aa9b07af0be006079a8b8992f7ceeced Mon Sep 17 00:00:00 2001 From: David Gallay Date: Sun, 14 Aug 2022 10:30:59 +0200 Subject: [PATCH] improve chart management --- layouts/_default/baseof.html | 16 ++++++++-------- layouts/shortcodes/chart.html | 16 ++++++---------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 4dc84f4..1162af7 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -3,6 +3,14 @@ {{- partial "head.html" . }} + {{ if .Page.Store.Get "hasChart" }} + + {{ end }} -{{ end }} */}} diff --git a/layouts/shortcodes/chart.html b/layouts/shortcodes/chart.html index be1aa04..67ec6d6 100644 --- a/layouts/shortcodes/chart.html +++ b/layouts/shortcodes/chart.html @@ -1,17 +1,13 @@

TEST

- - + {{ $data := index .Site.Data (split (.Get "data") ".") }} + {{ $chartID := .Get "id" | default (md5 (jsonify $data)) }} +
-{{/* {{ .Page.Store.Set "hasChart" true }} */}} +{{ .Page.Store.Set "hasChart" true }}