Hello! I’ve wrote the following shortcode:
{{ $hint := .Get "hint" }}
{{ $leftColor := "58158f" }}
{{ $rightColor := "000000" }}
{{ $logoColor := "e9e0ff" }}
{{ with .Get "leftColor" }}
{{ $leftColor = . }}
{{ end }}
{{ with .Get "rightColor" }}
{{ $rightColor = . }}
{{ end }}
{{ with .Get "logoColor" }}
{{ $logoColor = . }}
{{ end }}
{{ $params := "" }}
{{ with .Get "logoName" }}
{{ $params = printf "&logo=%s&logoColor=%s" . $logoColor }}
{{ end }}
<img src='https://img.shields.io/badge/{{ $hint }}-{{ $rightColor }}?labelColor={{ $leftColor }}{{ $params }}' alt="{{ $hint }}"></a>
When I use it as {{< badge hint="Docs-open" leftColor=purple rightColor=red >}}
everything works as expected:
But when I add logoColor=black logoName=github
params my badge breaks:
No logo is displayed and leftColor
is left. But when I write manually <img src='https://img.shields.io/badge/Docs-open-red?labelColor=purple&logo=github&logoColor=black' alt="{{ Docs-open }}"></a>
everything works:
I don’t understand how to fix it.