diff options
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/baseof.html | 2 | ||||
-rw-r--r-- | layouts/partials/assets.html | 10 | ||||
-rw-r--r-- | layouts/partials/plugin/image.html | 4 | ||||
-rw-r--r-- | layouts/shortcodes/bilibili.html | 4 | ||||
-rw-r--r-- | layouts/shortcodes/version.html | 11 |
5 files changed, 21 insertions, 10 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index d953768..fb97d56 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -49,7 +49,7 @@ {{- partial "footer.html" . -}} </div> - <div id="fixed-buttons" class="animated faster"> + <div id="fixed-buttons"> {{- /* top button */ -}} <a href="#" id="back-to-top" class="fixed-button" title="{{ T `backToTop` }}"> <i class="fas fa-arrow-up fa-fw"></i> diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index bfe8fbe..9352c3e 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -100,6 +100,14 @@ {{- $config = dict "lightGallery" $lightGalleryConfig | merge $config -}} {{- end -}} +{{- /* clipboard.js */ -}} +{{- with $CDN.clipboardJS -}} + {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}} +{{- else -}} + {{- dict "source" "lib/clipboard/clipboard.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}} +{{- end -}} +{{- $config = T "copyToClipboard" | dict "title" | dict "clipboard" | merge $config -}} + {{- /* Sharer.js */ -}} {{- if $scratch.Get "share" -}} {{- with $CDN.sharerJS -}} @@ -256,7 +264,7 @@ </script> {{- /* Polyfill.io */ -}} -{{- partial "plugin/script.html" (dict "source" "https://polyfill.io/v3/polyfill.min.js?features=Element.prototype.closest%2CrequestAnimationFrame%2CCustomEvent%2CPromise%2CObject.entries%2CObject.assign%2CObject.values%2Cfetch") -}} +{{- partial "plugin/script.html" (dict "source" "https://polyfill.io/v3/polyfill.min.js?features=Element.prototype.closest%2CrequestAnimationFrame%2CCustomEvent%2CPromise%2CObject.entries%2CObject.assign%2CObject.values%2Cfetch%2CElement.prototype.after") -}} {{- range $scratch.Get "script" -}} {{- partial "plugin/script.html" . -}} diff --git a/layouts/partials/plugin/image.html b/layouts/partials/plugin/image.html index 3710acf..f397909 100644 --- a/layouts/partials/plugin/image.html +++ b/layouts/partials/plugin/image.html @@ -1,5 +1,5 @@ {{- /* lazysizes and lightgallery.js */ -}} -{{- $loading := resources.Get "svg/loading.svg" | minify -}} +{{- $loading := resources.Get "svg/loading/normal.svg" | minify -}} {{- $small := .src_s | default .src -}} {{- $large := .src_l | default .src -}} {{- $alt := .alt | default .src -}} @@ -15,7 +15,7 @@ </a> {{- else -}} {{- if not .large -}} - {{- $loading = resources.Get "svg/loading.small.svg" | minify -}} + {{- $loading = resources.Get "svg/loading/small.svg" | minify -}} {{- end -}} <img class="lazyload" diff --git a/layouts/shortcodes/bilibili.html b/layouts/shortcodes/bilibili.html index d553fc2..c14cdc9 100644 --- a/layouts/shortcodes/bilibili.html +++ b/layouts/shortcodes/bilibili.html @@ -1,7 +1,7 @@ <div class="bilibili"> {{- if .IsNamedParams -}} - <iframe src="https://player.bilibili.com/player.html?bvid={{ .Get `id` }}&page={{ .Get `p` | default 1 }}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe> + <iframe src="//player.bilibili.com/player.html?bvid={{ .Get `id` }}&page={{ .Get `p` | default 1 }}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe> {{- else -}} - <iframe src="https://player.bilibili.com/player.html?bvid={{ .Get 0 }}&page={{ .Get 1 | default 1 }}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe> + <iframe src="//player.bilibili.com/player.html?bvid={{ .Get 0 }}&page={{ .Get 1 | default 1 }}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe> {{- end -}} </div> diff --git a/layouts/shortcodes/version.html b/layouts/shortcodes/version.html index 5977638..ac5f3c9 100644 --- a/layouts/shortcodes/version.html +++ b/layouts/shortcodes/version.html @@ -1,7 +1,10 @@ {{- $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 -}} +{{- $type := .Get 1 | default "new" | lower -}} +{{- $label := T $type -}} +{{- $color := cond (eq $type "changed") "ff9101" "00b1ff" | cond (eq $type "deleted") "ff5252" -}} +{{- $path := printf "svg/version/%s-%s.svg" $version $label -}} +{{- $res := resources.Get "svg/version.template.svg" -}} +{{- $res = $res | resources.ExecuteAsTemplate $path (dict "version" $version "label" $label "color" $color) | minify -}} {{- $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 +<span class="version"><a href="{{ $url }}" rel="noopener noreffer" target="_blank">{{ partial "plugin/image.html" (dict "src" $res.RelPermalink "alt" $alt) }}</a></span>
\ No newline at end of file |