From a71e9c7f73084c0a34c0b1752f1c3cb4dcf753ce Mon Sep 17 00:00:00 2001 From: PCloud Date: Tue, 24 Dec 2024 15:25:56 +0000 Subject: [PATCH] fix: only display button in single pages --- assets/css/main.css | 150 +++++------------------------------ layouts/_default/baseof.html | 3 + layouts/posts/single.html | 1 + 3 files changed, 24 insertions(+), 130 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index 929b636c6..cdec0065f 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -781,60 +781,38 @@ html.dark { position: fixed; } -.tw-bottom-20 { - bottom: 5rem; -} - -.tw-bottom-10 { - bottom: 2.5rem; -} - -.tw-bottom-12 { - bottom: 3rem; -} - -.tw-bottom-8 { - bottom: 2rem; -} - -.tw-right-6 { - right: 1.5rem; -} - -.tw-right-8 { - right: 2rem; +.tw-bottom-4 { + bottom: 1rem; } .tw-right-4 { right: 1rem; } -.tw-bottom-4 { - bottom: 1rem; -} - .tw-m-0 { margin: 0px; } -.tw-m-4 { - margin: 1rem; -} - -.tw-m-2 { - margin: 0.5rem; -} - .\!tw-my-1 { margin-top: 0.25rem !important; margin-bottom: 0.25rem !important; } +.tw-mx-0 { + margin-left: 0px; + margin-right: 0px; +} + .tw-mx-2 { margin-left: 0.5rem; margin-right: 0.5rem; } +.tw-mx-4 { + margin-left: 1rem; + margin-right: 1rem; +} + .tw-my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; @@ -845,36 +823,15 @@ html.dark { margin-bottom: 1rem; } -.tw-my-0 { - margin-top: 0px; - margin-bottom: 0px; -} - -.tw-mx-4 { - margin-left: 1rem; - margin-right: 1rem; -} - -.tw-mx-auto { - margin-left: auto; - margin-right: auto; -} - -.tw-mx-0 { - margin-left: 0px; - margin-right: 0px; -} - -.tw-my-8 { - margin-top: 2rem; - margin-bottom: 2rem; -} - .tw-my-6 { margin-top: 1.5rem; margin-bottom: 1.5rem; } +.tw-ml-16 { + margin-left: 4rem; +} + .tw-ml-4 { margin-left: 1rem; } @@ -883,42 +840,6 @@ html.dark { margin-right: 0.25rem; } -.tw-mr-0 { - margin-right: 0px; -} - -.tw-ml-10 { - margin-left: 2.5rem; -} - -.tw-ml-\[20\] { - margin-left: 20; -} - -.tw-ml-\[20px\] { - margin-left: 20px; -} - -.tw-ml-\[200px\] { - margin-left: 200px; -} - -.tw-ml-8 { - margin-left: 2rem; -} - -.tw-ml-1 { - margin-left: 0.25rem; -} - -.tw-ml-16 { - margin-left: 4rem; -} - -.tw-ml-2 { - margin-left: 0.5rem; -} - .\!tw-block { display: block !important; } @@ -976,10 +897,6 @@ html.dark { width: 100%; } -.tw-w-11\/12 { - width: 91.666667%; -} - .tw-max-w-full { max-width: 100%; } @@ -1017,10 +934,6 @@ html.dark { justify-content: space-between; } -.tw-gap-2 { - gap: 0.5rem; -} - .tw-gap-1 { gap: 0.25rem; } @@ -1041,10 +954,6 @@ html.dark { border-radius: 9999px; } -.tw-rounded { - border-radius: 0.25rem; -} - .tw-border-t-2 { border-top-width: 2px; } @@ -1062,27 +971,18 @@ html.dark { background-color: transparent; } -.tw-bg-white { - --tw-bg-opacity: 1; - background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1)); -} - .tw-p-0 { padding: 0px; } -.tw-p-4 { - padding: 1rem; -} - -.tw-p-2 { - padding: 0.5rem; -} - .tw-p-1 { padding: 0.25rem; } +.tw-p-4 { + padding: 1rem; +} + .tw-px-4 { padding-left: 1rem; padding-right: 1rem; @@ -1093,11 +993,6 @@ html.dark { padding-bottom: 0.5rem; } -.tw-py-0 { - padding-top: 0px; - padding-bottom: 0px; -} - .tw-pb-8 { padding-bottom: 2rem; } @@ -1120,11 +1015,6 @@ html.dark { line-height: 1.5rem; } -.tw-text-xl { - font-size: 1.25rem; - line-height: 1.75rem; -} - .tw-uppercase { text-transform: uppercase; } diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 2b4c437c3..97743a329 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -88,9 +88,12 @@ {{ partial "plugin/fontawesome.html" (dict "Style" "solid" "Icon" "arrow-up") }} + {{/* toc dialog button */}} + {{- if .Page.Scratch.Get "enableTocDialog" -}} + {{- end -}} {{- /* comment button */ -}} {{- if .Page.Scratch.Get "enableComment" -}} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 23f6ba3b5..6cb6f4b49 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -22,6 +22,7 @@

{{ T "contents" }}

{{- end -}} {{/* TOC Dialog */}} + {{- .Page.Scratch.Set "enableTocDialog" true -}}

{{ T "contents" }}