Welcome to mirror list, hosted at ThFree Co, Russian Federation.

show.html « c « shortcodes « layouts - github.com/vjeantet/hugo-theme-docport.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 830c7843a9e6de8fcd88ffaac65d6274ce9627fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{{ $random := delimit (shuffle (split (md5 .Page.File.UniqueID) "" )) "" }}
{{ $id := printf "dp-show-%s" $random}}
{{ $condition := trim (.Get 0) " "}}
{{ $regFormValue := printf "formValue('$1')"}}
{{ $conditionFix := replaceRE `{(\w+)}` $regFormValue $condition  }}
{{ $conditionFix = replace $conditionFix ` and ` ` && `  }}
{{ $conditionFix = replace $conditionFix ` or ` ` || `  }}
{{ $conditionFix = replaceRE  `[^)]+has\s+('\w+')` ".includes($1)" $conditionFix }}

<div id="{{$id}}" class="baz" style="display:none" cond="{{$conditionFix | safeHTMLAttr}}">
{{with .Get 1}}
<input type="hidden" value="true" name="{{.}}">
{{end}}
{{.Inner | markdownify}}</div>