{{/* Hugo Blox: Skills */}} {{/* Documentation: https://hugoblox.com/blocks/ */}} {{/* License: https://github.com/HugoBlox/hugo-blox-builder/blob/main/LICENSE.md */}} {{/* Initialise */}} {{ $page := .wcPage }} {{ $block := .wcBlock }} {{ $author := $block.content.username | default "me" }} {{ $profile := partial "functions/get_author_profile" $author }} {{ $skills := $profile.skills | default (slice) }}
{{ $block.content.title | markdownify | emojify }}
{{ with $block.content.text }}

{{ . | markdownify | emojify }}

{{ end }}
{{ $columns := $block.design.columns | default 2 }}
{{ range $skills }} {{ $color := .color | default "" }} {{ $color_border := .color_border | default "" }}
{{ .name | markdownify | emojify }} {{ with .description }}

{{ . | markdownify | emojify }}

{{ end }}
{{ range (.items | default (slice)) }}
{{ with .icon }} {{ partial "functions/get_icon" (dict "name" . "attributes" "style=\"height: 1em;\"") }} {{ end }} {{ $label := .label | default .name }} {{ $label | markdownify | emojify }} {{ with .description }}

{{ . | markdownify | emojify }}

{{ end }}
{{/* Numeric level (1-5) only. */}} {{ $level := 0.0 }} {{ if isset . "level" }} {{ $raw := .level }} {{ $type := printf "%T" $raw }} {{ if or (eq $type "int") (eq $type "int64") (eq $type "int32") (eq $type "int16") (eq $type "int8") (eq $type "uint") (eq $type "uint64") (eq $type "uint32") (eq $type "uint16") (eq $type "uint8") (eq $type "float64") (eq $type "float32") }} {{ $level = float $raw }} {{ end }} {{ end }} {{ if gt $level 5 }}{{ $level = 5 }}{{ end }} {{ if lt $level 0 }}{{ $level = 0 }}{{ end }} {{ if gt $level 0 }} {{ $levelPercent := mul $level 20 }}
{{ end }}
{{ end }}
{{ end }}