From 3d84d968694dbed1ee6abde99c7cf31228b3540e Mon Sep 17 00:00:00 2001 From: shaojiemike <943648187@qq.com> Date: Mon, 8 Apr 2024 19:27:57 +0800 Subject: [PATCH] feat: move sidebar to right --- layouts/_default/single.html | 27 +++++++++++++++------------ layouts/events/single.html | 1 - layouts/news/single.html | 1 - static/css/style6Events.css | 14 +++++++++++++- 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index af17ac6..1ec47b9 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,4 +1,5 @@ {{ define "main" }} +
{{ with .Params.img_url }} @@ -42,21 +43,23 @@

{{ .Params.title } {{ $root := . }} - - - {{ if gt (len .TableOfContents) 32 }} - - {{ else }} - - {{ end }} + + {{ .Content }}

+ + + +{{ if gt (len .TableOfContents) 32 }} + +{{ else }} + +{{ end }} {{ end }} \ No newline at end of file diff --git a/layouts/events/single.html b/layouts/events/single.html index 603ef6f..fc6e64d 100644 --- a/layouts/events/single.html +++ b/layouts/events/single.html @@ -36,7 +36,6 @@

{{ .Params.title }
{{ .TableOfContents }}
- {{ else }} diff --git a/layouts/news/single.html b/layouts/news/single.html index b55be07..156082f 100644 --- a/layouts/news/single.html +++ b/layouts/news/single.html @@ -40,7 +40,6 @@

{{ .Params.title
{{ .TableOfContents }}
- {{ else }} diff --git a/static/css/style6Events.css b/static/css/style6Events.css index bf88f93..356bf48 100644 --- a/static/css/style6Events.css +++ b/static/css/style6Events.css @@ -42,11 +42,23 @@ top:3px; } -.sidebar{ + /* 嵌入在正文的简单模式 */ +/* .sidebar{ padding-top: 0.1em; position: sticky; top: 5.6em; background-color: #9dbeff; +} */ + + +.sidebar{ + position: fixed; + right: 10px; + top: 30%; + background-color: #cfdeff; + border-radius: 10px; /* 设置圆角的大小 */ + word-wrap: break-word; /* 或 overflow-wrap: break-word; 允许长单词或URL地址在任何字符之间断行 */ + word-break: break-word; /* 为了兼容性,同时使用这两个属性 */ } .sidebar .accordion a{