From 6c9a2fe2e0df2db03ed6f5ac8ec9d89136c671ca Mon Sep 17 00:00:00 2001
From: 6543 <6543@obermui.de>
Date: Sun, 14 Jul 2019 00:30:39 +0200
Subject: [PATCH] add imgping to on-off shortcode now if a image can be
downloadet the service stateis on else off
---
layouts/shortcodes/on-off.html | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/layouts/shortcodes/on-off.html b/layouts/shortcodes/on-off.html
index e2d2308..0f74280 100644
--- a/layouts/shortcodes/on-off.html
+++ b/layouts/shortcodes/on-off.html
@@ -1,8 +1,26 @@
-{{ $mode := .Get 0 }}
+{{ $mode := .Get 0 }}{{ $opt := .Get 1 }}
+
+{{ $img_on := ( printf "%s%s" $.Page.Site.BaseURL "img/on-off/switch-on-icon_smal.png" )}}
+{{ $img_off := ( printf "%s%s" $.Page.Site.BaseURL "img/on-off/switch-off-icon_smal.png" )}}
+
{{ if eq $mode "on" }}
-
+
{{ else if eq $mode "off"}}
-
+
+{{ else if eq $mode "imgping" }}
+ {{ with $opt }}
+ {{ $id := md5 $opt }}
+
+
+ {{ else }}
+ Ned URL to image
+ {{ end }}
{{ else }}
???
-{{end}}
+{{ end }}