Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/uPagge/uBlogger.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDillon <dillonzq@outlook.com>2020-03-19 11:54:47 +0300
committerGitHub <noreply@github.com>2020-03-19 11:54:47 +0300
commita9850f7df3184f4f0cbb7e2415377e1705b9671d (patch)
treed21784dfbd6252575e0abd8d99c1bb325aa6e377 /layouts
parent774e831a210e44aeca9848eb0d636aae5af009dd (diff)
docs: improve version used for docs (#188)
Diffstat (limited to 'layouts')
-rw-r--r--layouts/shortcodes/version.html8
1 files changed, 7 insertions, 1 deletions
diff --git a/layouts/shortcodes/version.html b/layouts/shortcodes/version.html
index c115cd2..5977638 100644
--- a/layouts/shortcodes/version.html
+++ b/layouts/shortcodes/version.html
@@ -1 +1,7 @@
-<span class="version"><i class="far fa-heart fa-fw"></i> LoveIt <i class="fas fa-greater-than-equal fa-fw"></i> <a href="https://github.com/dillonzq/LoveIt/releases/tag/v{{ .Get 0 }}" rel="noopener noreffer" target="_blank" title="LoveIt v{{ .Get 0 }}">{{ .Get 0 }}</a></span> \ No newline at end of file
+{{- $version := .Get 0 -}}
+{{- $url := printf "https://github.com/dillonzq/LoveIt/releases/tag/v%s" $version -}}
+{{- $label := .Get 1 | default "new" | T -}}
+{{- $color := cond (.Get 1 | eq "changed") "ff9101" "00b1ff" | cond (.Get 1 | eq "deleted") "ff5252" -}}
+{{- $badge := printf "https://img.shields.io/badge/%s-%s-%s?style=flat-square&labelColor=403c3d&?cacheSeconds=maxAge" $label $version $color -}}
+{{- $alt := printf "LoveIt %s | %s" $label $version -}}
+<span class="version{{ if .Get 2 | eq `small` }} small{{ end }}"><a href="{{ $url }}" rel="noopener noreffer" target="_blank">{{ partial "plugin/image.html" (dict "src" $badge "alt" $alt) }}</a></span> \ No newline at end of file