diff --git a/exampleSite/content/posts/advanced/shortcodes.md b/exampleSite/content/posts/advanced/shortcodes.md index a2de217..838589e 100644 --- a/exampleSite/content/posts/advanced/shortcodes.md +++ b/exampleSite/content/posts/advanced/shortcodes.md @@ -450,7 +450,8 @@ Text continues here. | Name | Description | default | | ---------------- | -------------------------------------------------------------------------------- | --------- | -| value | progress value | 0 | +| value | progress value (0-100) | 0 | +| label | value to display | value | | icon (optional) | icon to use, need to be an icon from an [SVG sprite](/posts/features/icon-sets/) | undefined | | title (optional) | progress title | undefined | diff --git a/layouts/shortcodes/progress.html b/layouts/shortcodes/progress.html index d9da6d4..4b2027e 100644 --- a/layouts/shortcodes/progress.html +++ b/layouts/shortcodes/progress.html @@ -1,4 +1,5 @@ {{- $value := default 0 (.Get "value") -}} +{{- $label := default (printf "%v %%" $value) (.Get "label") -}} {{- $title := .Get "title" -}} {{- $icon := .Get "icon" -}} @@ -11,13 +12,13 @@ {{- end }} {{ with $title }}{{ . }}{{ end }} -
{{ $value }}%
+
{{ $label }}