mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
Merge pull request #2495 from ZhenShuo2021/fix/page-widget
🐛 Fix: page widget
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
lang="{{ with site.Params.isoCode | default (site.LanguageCode | default " en") }}{{- . -}}{{ end }}"
|
||||
dir="{{ if site.Params.rtl | default false -}}
|
||||
rtl
|
||||
{{- else -}}
|
||||
ltr
|
||||
{{- end }}"
|
||||
lang="{{ with site.Params.isoCode | default (site.LanguageCode | default `en`) }}{{- . -}}{{ end }}"
|
||||
dir="{{ cond (site.Params.rtl | default false) `rtl` `ltr` }}"
|
||||
class="scroll-smooth"
|
||||
data-default-appearance="{{ site.Params.defaultAppearance | default " light" }}"
|
||||
data-auto-appearance="{{ site.Params.autoSwitchAppearance | default " true" }}">
|
||||
data-default-appearance="{{ site.Params.defaultAppearance | default `light` }}"
|
||||
data-auto-appearance="{{ site.Params.autoSwitchAppearance | default `true` }}">
|
||||
{{- partial "head.html" . -}}
|
||||
|
||||
|
||||
@@ -48,9 +44,9 @@
|
||||
src="https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js"
|
||||
data-id="{{ site.Params.buymeacoffee.identifier }}"
|
||||
data-description="Support me on Buy me a coffee!"
|
||||
data-message="{{ site.Params.buymeacoffee.globalWidgetMessage | default "" }}"
|
||||
data-color="{{ site.Params.buymeacoffee.globalWidgetColor | default "#FFDD00" }}"
|
||||
data-position="{{ site.Params.buymeacoffee.globalWidgetPosition | default "Left" }}"
|
||||
{{ with site.Params.buymeacoffee.globalWidgetMessage }}data-message="{{ . }}"{{ end }}
|
||||
{{ with site.Params.buymeacoffee.globalWidgetColor | default `#FFDD00` }}data-color="{{ . }}"{{ end }}
|
||||
{{ with site.Params.buymeacoffee.globalWidgetPosition }}data-position="{{ . }}"{{ end }}
|
||||
data-x_margin="18"
|
||||
data-y_margin="18"></script>
|
||||
{{ end }}
|
||||
|
||||
@@ -69,6 +69,10 @@
|
||||
type="text/javascript"
|
||||
src="{{ $jsAppearance.RelPermalink }}"
|
||||
integrity="{{ $jsAppearance.Data.Integrity }}"></script>
|
||||
{{ if site.Params.footer.showScrollToTop | default true }}
|
||||
{{ $jsToTop := resources.Get "js/scroll-to-top.js" }}
|
||||
{{ $assets.Add "js" (slice $jsToTop) }}
|
||||
{{ end }}
|
||||
{{ if .Site.Params.enableA11y | default false }}
|
||||
{{ $jsA11y := resources.Get "js/a11y.js" }}
|
||||
{{ $jsA11y = $jsA11y | resources.Minify | resources.Fingerprint (site.Params.fingerprintAlgorithm | default "sha512") }}
|
||||
@@ -83,6 +87,10 @@
|
||||
src="{{ $jsZenMode.RelPermalink }}"
|
||||
integrity="{{ $jsZenMode.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
{{ if site.Params.footer.showScrollToTop | default true }}
|
||||
{{ $jsToTop := resources.Get "js/scroll-to-top.js" }}
|
||||
{{ $assets.Add "js" (slice $jsToTop) }}
|
||||
{{ end }}
|
||||
{{ if .Site.Params.enableSearch | default false }}
|
||||
{{ $jsFuse := resources.Get "lib/fuse/fuse.min.js" }}
|
||||
{{ $jsSearch := resources.Get "js/search.js" }}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
<div id="top-scroller" class="pointer-events-none absolute top-[110vh] bottom-0 w-12 ltr:right-0 rtl:left-0 z-10">
|
||||
{{ $coffeeIsRight := and site.Params.buymeacoffee.globalWidget (eq (lower site.Params.buymeacoffee.globalWidgetPosition) "right") }}
|
||||
{{ $toTopYOffset := cond $coffeeIsRight "bottom-24" "bottom-6" }}
|
||||
<div
|
||||
id="scroll-to-top"
|
||||
class="fixed {{ $toTopYOffset }} end-6 z-50 transform translate-y-4 opacity-0 duration-200">
|
||||
<a
|
||||
href="#the-top"
|
||||
class="pointer-events-auto sticky top-[calc(100vh-5.5rem)] flex h-12 w-12 mb-16 items-center justify-center rounded-full bg-neutral/50 text-xl text-neutral-700 hover:text-primary-600 dark:bg-neutral-800/50 dark:text-neutral dark:hover:text-primary-400"
|
||||
class="pointer-events-auto flex h-12 w-12 items-center justify-center rounded-full bg-neutral/50 text-xl text-neutral-700 hover:text-primary-600 dark:bg-neutral-800/50 dark:text-neutral dark:hover:text-primary-400"
|
||||
aria-label="{{ i18n "nav.scroll_to_top_title" }}"
|
||||
title="{{ i18n "nav.scroll_to_top_title" }}">
|
||||
↑
|
||||
|
||||
Reference in New Issue
Block a user