From b43c043a7b9153e5cf6a1a30b057d143b1cedc52 Mon Sep 17 00:00:00 2001 From: vjeantet Date: Thu, 5 Nov 2020 23:30:56 +0100 Subject: fix some css --- layouts/partials/_checklist-footer.html | 8 -- layouts/partials/_checklist-header.html | 16 --- layouts/partials/_menu.html | 4 +- layouts/partials/_skwad-footer.html | 21 ++++ layouts/partials/_skwad-header.html | 181 +++++++++++++++++++++++++++++ layouts/partials/body-article-content.html | 4 +- layouts/shortcodes/c/show.html | 4 +- 7 files changed, 207 insertions(+), 31 deletions(-) delete mode 100644 layouts/partials/_checklist-footer.html delete mode 100644 layouts/partials/_checklist-header.html create mode 100644 layouts/partials/_skwad-footer.html create mode 100644 layouts/partials/_skwad-header.html (limited to 'layouts') diff --git a/layouts/partials/_checklist-footer.html b/layouts/partials/_checklist-footer.html deleted file mode 100644 index 009e6fc..0000000 --- a/layouts/partials/_checklist-footer.html +++ /dev/null @@ -1,8 +0,0 @@ -{{if .Params.checklist}} - - -{{end}} diff --git a/layouts/partials/_checklist-header.html b/layouts/partials/_checklist-header.html deleted file mode 100644 index 4426680..0000000 --- a/layouts/partials/_checklist-header.html +++ /dev/null @@ -1,16 +0,0 @@ -{{if .Params.checklist}} - {{ $formID := .File.UniqueID }} - -
- - - -
- - -
-{{end}} \ No newline at end of file diff --git a/layouts/partials/_menu.html b/layouts/partials/_menu.html index 658274e..148bb6d 100644 --- a/layouts/partials/_menu.html +++ b/layouts/partials/_menu.html @@ -20,8 +20,7 @@ {{if lt $level $maxlevel }} {{- with .sect}} {{- if and .IsSection (or (not .Params.hidden) $.showhidden)}} - {{- $numberOfPages := (len .Sections) }} - {{- $numberOfPages := (len (where .Sections "Params.subpage" "ne" true)) }} + {{- $numberOfPages := (len (where (where .Sections "Params.subpage" "ne" true) "Params.hidden" "ne" true )) }} {{- safeHTML .Params.head}}
  • {{safeHTML .Params.Pre}}{{$menuTitle}}{{safeHTML .Params.Post}} {{end}} - {{- if and (ne $numberOfPages 0) (lt (add $level 1) $maxlevel) }} {{- if or (.IsAncestor $currentNode) (.Params.alwaysopen) }} diff --git a/layouts/partials/_skwad-footer.html b/layouts/partials/_skwad-footer.html new file mode 100644 index 0000000..da9c5bd --- /dev/null +++ b/layouts/partials/_skwad-footer.html @@ -0,0 +1,21 @@ +{{if .Params.skwad}} + + + {{if ne nil .Params.skwad.mode }} + + {{end}} + +
  • + {{if eq true .Params.skwad.clientside}} + {{if .Params.skwad.url }} + + {{end}} + {{end}} +{{end}} \ No newline at end of file diff --git a/layouts/partials/_skwad-header.html b/layouts/partials/_skwad-header.html new file mode 100644 index 0000000..b0d2877 --- /dev/null +++ b/layouts/partials/_skwad-header.html @@ -0,0 +1,181 @@ +{{if .Params.skwad}} + {{ $formID := .File.UniqueID }} + + + {{if .Params.skwad.url }} + + + {{end}} +
    + + + {{if eq true .Params.skwad.clientside}} +
    + + +
    + {{end}} +{{end}} \ No newline at end of file diff --git a/layouts/partials/body-article-content.html b/layouts/partials/body-article-content.html index 73f2abf..93e1dfb 100644 --- a/layouts/partials/body-article-content.html +++ b/layouts/partials/body-article-content.html @@ -75,9 +75,9 @@
    {{- with .Content -}} - {{ partial "_checklist-header.html" $ }} + {{ partial "_skwad-header.html" $ }} {{ . | replaceRE "()" `${1} ref="${2}" ${3}${4}` | safeHTML }} - {{ partial "_checklist-footer.html" $ }} + {{ partial "_skwad-footer.html" $ }} {{- else -}} {{with index .Pages 0}} diff --git a/layouts/shortcodes/c/show.html b/layouts/shortcodes/c/show.html index 830c784..8f854bd 100644 --- a/layouts/shortcodes/c/show.html +++ b/layouts/shortcodes/c/show.html @@ -1,13 +1,13 @@ {{ $random := delimit (shuffle (split (md5 .Page.File.UniqueID) "" )) "" }} {{ $id := printf "dp-show-%s" $random}} {{ $condition := trim (.Get 0) " "}} -{{ $regFormValue := printf "formValue('$1')"}} +{{ $regFormValue := printf "skwad.fValue('$1')"}} {{ $conditionFix := replaceRE `{(\w+)}` $regFormValue $condition }} {{ $conditionFix = replace $conditionFix ` and ` ` && ` }} {{ $conditionFix = replace $conditionFix ` or ` ` || ` }} {{ $conditionFix = replaceRE `[^)]+has\s+('\w+')` ".includes($1)" $conditionFix }} -