From 9628ab9de1e228c09a33e96efbb8e7ad53b286e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=A1=E6=A2=A6=E6=98=9F=E5=B0=98?= Date: Mon, 9 May 2022 14:37:01 +0800 Subject: [PATCH] :construction: :sparkles: :wrench: Finish the sidebar features develop tasks. --- assets/css/style.css | 33 +++++++++++++++++++++------- exampleSite/config.yaml | 27 ++++++++++++++++++++++- layouts/partials/header/sidebar.html | 2 ++ 3 files changed, 53 insertions(+), 9 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index 00eec91..659fe9a 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -1,21 +1,34 @@ /** User-defined style. **/ -{{- $P := .Site.Params -}} +{{ $P := .Site.Params -}} +{{- with $P.sidebar -}} +.main { +{{ if eq .position "right" }} + flex-direction: row-reverse; +{{- end }} +} +.header-inner { + width: {{ .width }}px; +} +.main-inner { + width: calc(100% - {{ add .width .offset }}px); +} .sidebar { + width: {{ .width }}px; visibility: inherit; } - .sidebar-inner { - padding: 10px; + padding: {{ .padding }} 10px; } +{{- end }} .site-author-image { -{{ if $P.avatar.rounded }} +{{- if $P.avatar.rounded }} border-radius:50%; -{{ end }} -{{ if $P.avatar.rotated }} +{{- end }} +{{- if $P.avatar.rotated }} transition: transform 1s ease-out; -{{ end }} +{{- end }} } .back-to-top { @@ -74,5 +87,9 @@ } .cc-license { +{{ if eq $P.creativeCommons.size "big" }} + margin-top: 10px; +{{ else }} margin-top: 5px; -} \ No newline at end of file +{{- end }} +} diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index be76b66..ff9e740 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -72,6 +72,28 @@ params: # admins: # app_id: + sidebar: + # Sidebar Position. + #position: left | right + position: left + + # Manual define the sidebar width. If commented, will be default for: + # Muse | Mist: 320 + # Pisces | Gemini: 240 + width: 256 + + # Sidebar Display (only for Muse | Mist), available values: + # - post expand on posts automatically. Default. + # - always expand for all pages automatically. + # - hide expand only when click on the sidebar toggle icon. + # - remove totally remove sidebar including sidebar toggle. + display: post + + # Sidebar padding in pixels. + padding: 30 + # Sidebar offset from top menubar in pixels (only for Pisces | Gemini). + offset: 18 + # Sidebar Avatar avatar: # Replace the default image and set the url here. @@ -81,6 +103,9 @@ params: # If true, the avatar will be rotated with the cursor. rotated: true + # Show Posts / Categories / Tags label in sidebar. + siteState: true + # Social Links # Usage: `Key: permalink || icon` # Key is the link label showing to end users. @@ -104,7 +129,7 @@ params: # Available values: by | by-nc | by-nc-nd | by-nc-sa | by-nd | by-sa | cc-zero license: by-nc-nd # Available values: big | small - size: small + size: big sidebar: true post: true # You can set a language value if you prefer a translated version of CC license, e.g. deed.zh diff --git a/layouts/partials/header/sidebar.html b/layouts/partials/header/sidebar.html index a6621da..93f4d0e 100644 --- a/layouts/partials/header/sidebar.html +++ b/layouts/partials/header/sidebar.html @@ -17,6 +17,7 @@
{{ $SP.description }}