From 5a00eaf362b4a3a4dd39f772bb11e7a2194bdffc Mon Sep 17 00:00:00 2001
From: 6543 <6543@obermui.de>
Date: Sun, 14 Jul 2019 00:43:31 +0200
Subject: [PATCH] add default falue to imgping in on-of shortcode
---
layouts/shortcodes/on-off.html | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/layouts/shortcodes/on-off.html b/layouts/shortcodes/on-off.html
index 0f74280..4194899 100644
--- a/layouts/shortcodes/on-off.html
+++ b/layouts/shortcodes/on-off.html
@@ -1,4 +1,4 @@
-{{ $mode := .Get 0 }}{{ $opt := .Get 1 }}
+{{ $mode := .Get 0 }}{{ $opt1 := .Get 1 }}{{ $opt2 := .Get 2 }}
{{ $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" )}}
@@ -8,18 +8,24 @@
{{ else if eq $mode "off"}}
{{ else if eq $mode "imgping" }}
- {{ with $opt }}
- {{ $id := md5 $opt }}
-
+ {{ with $opt1 }}
+ {{ $id := md5 $opt1 }}
+ {{ if eq $opt2 "on" }}
+
+ {{ else }}
+
+ {{ end }}
{{ else }}
- Ned URL to image
+ imgping [URL to image] [default on/off]
{{ end }}
{{ else }}
???