{{/* Hugo Blox: Languages */}} {{/* 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 }} {{ $langs := $profile.languages }}
{{ $block.content.title | markdownify | emojify }}
{{ with $block.content.text }}

{{ . | markdownify | emojify }}

{{ end }}
{{ range $langs }} {{ $percent := 100.0 }} {{ $levelText := .level }} {{ $label := .label }} {{ $levelStr := printf "%v" ($levelText | default "") }} {{ $numericLevel := gt (len (findRE "^[0-9]+(?:\\.[0-9]+)?$" $levelStr)) 0 }} {{ if $numericLevel }} {{ $percent = mul (float $levelStr) 20 }} {{ else if .percent }} {{ $percent = float .percent }} {{ end }} {{ if gt $percent 100 }}{{ $percent = 100 }}{{ end }} {{ if lt $percent 0 }}{{ $percent = 0 }}{{ end }}
{{ $percent }}%
{{.name}} {{ if $label }} {{ $label }} {{ else if and $levelText (not $numericLevel) }} {{ . }} {{ end }}
{{ end }}