feat(blox): optionally hide skill percent

when `percent` field is empty

As requested in https://discord.com/channels/722225264733716590/1213513275069960263/1213513275069960263
This commit is contained in:
George Cushen 2024-03-02 18:04:22 +00:00
commit cee6e1e3e1
2 changed files with 4 additions and 0 deletions

View file

@ -59,9 +59,11 @@
{{ .name | markdownify | emojify }}
{{ with .description }}<p class="skills-description">{{ . | markdownify | emojify }}</p>{{ end }}
</span>
{{ if .percent }}
<div class="skills-wrapper" {{with $color_border}}{{ (printf "style=\"border-color: %s\"" .) | safeHTMLAttr }}{{end}}>
<div class="skills-percent" style="width: {{ (printf "%s" (cast.ToString (.percent | default 100))) | safeCSS }}%; {{with $color}}{{ (printf "background-color: %s" .) | safeCSS }}{{end}}"></div>
</div>
{{ end }}
</div>
{{ end }}
</div>