From e7b34b5e1dac666866660436bb0fa80e1bef6079 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 6 Jan 2021 23:23:09 +0800 Subject: [PATCH] Add one-click return to the top function on the article page Signed-off-by: Ray --- layouts/_default/single.html | 2 ++ layouts/partials/arrow.html | 5 +++++ layouts/partials/head.html | 2 ++ static/css/style.css | 11 +++++++++++ 4 files changed, 20 insertions(+) create mode 100644 layouts/partials/arrow.html create mode 100644 layouts/partials/head.html diff --git a/layouts/_default/single.html b/layouts/_default/single.html index a83c6b3..2215bf4 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -31,6 +31,8 @@ {{ end }} {{ define "content" }} + +{{ partial "arrow.html" . }}
diff --git a/layouts/partials/arrow.html b/layouts/partials/arrow.html new file mode 100644 index 0000000..ad73f2c --- /dev/null +++ b/layouts/partials/arrow.html @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..3f794ea --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/static/css/style.css b/static/css/style.css index 3776d67..daa421c 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -44,3 +44,14 @@ /* iPhone 5 or before */ @media only screen and (max-width: 320px) { } + +/* Back to top */ +.backtop { + color: #b3b1b1; + position: fixed; + right: 16px; + bottom: 16px; + width: 32px; + height: 32px; + z-index: 999998; +} \ No newline at end of file