mirror of
https://github.com/idanoo/m2.nz
synced 2025-07-03 13:52:13 +00:00
Update theme (LoveIt) + Add new fields
This commit is contained in:
parent
ec90ebd36e
commit
49c98d8fb5
87 changed files with 6900 additions and 6013 deletions
18
themes/LoveIt/layouts/partials/function/bool.html
Normal file
18
themes/LoveIt/layouts/partials/function/bool.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
{{- /* To Bool */ -}}
|
||||
{{- $bool := . -}}
|
||||
|
||||
{{- if eq . true -}}
|
||||
{{- $bool = true -}}
|
||||
{{- else if eq . false -}}
|
||||
{{- $bool = false -}}
|
||||
{{- else if eq . "true" -}}
|
||||
{{- $bool = true -}}
|
||||
{{- else if eq . "false" -}}
|
||||
{{- $bool = false -}}
|
||||
{{- else if eq . "1" -}}
|
||||
{{- $bool = true -}}
|
||||
{{- else if eq . "0" -}}
|
||||
{{- $bool = false -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- return $bool -}}
|
14
themes/LoveIt/layouts/partials/function/dict.html
Normal file
14
themes/LoveIt/layouts/partials/function/dict.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
{{- /* To Dict */ -}}
|
||||
{{- /* "a=1, b=2" -> dict "a" "1" "b" "2" */ -}}
|
||||
{{- $dict := dict -}}
|
||||
|
||||
{{- if reflect.IsMap . -}}
|
||||
{{- $dict = . -}}
|
||||
{{- else -}}
|
||||
{{- range split . "," -}}
|
||||
{{- $parts := split (trim . " ") "=" -}}
|
||||
{{- $dict = dict (index $parts 0) (delimit (after 1 $parts) "") | merge $dict -}}
|
||||
{{- end -}}}
|
||||
{{- end -}}
|
||||
|
||||
{{- return $dict -}}
|
Loading…
Add table
Add a link
Reference in a new issue