Skip to content

Commit

Permalink
feat: move sidebar to right
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirrito-k423 committed Apr 8, 2024
1 parent 24e199f commit 3d84d96
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.
27 changes: 15 additions & 12 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{ define "main" }}

<div class="topdown-main">
<div class="publications-column full4footer">
{{ with .Params.img_url }}
Expand Down Expand Up @@ -42,21 +43,23 @@ <h1 style="text-align:left; font-size: xx-large;color:black;">{{ .Params.title }
<!-- <hr aria-hidden="true"> -->
{{ $root := . }}

<!-- {{ (len .TableOfContents) }} -->


{{ if gt (len .TableOfContents) 32 }}
<div class="sidebar">
<div class="accordion" id="markdownToc">
{{ .TableOfContents }}
</div>
<hr aria-hidden="true">
</div>
{{ else }}
<!-- <p>No table of contents available.</p> -->
{{ end }}
<!-- this is default single page -->
<hr aria-hidden="true">

{{ .Content }}
</div>
</div>


<!-- {{ (len .TableOfContents) }} -->
{{ if gt (len .TableOfContents) 32 }}
<div class="sidebar">
<div class="accordion" id="markdownToc">
{{ .TableOfContents }}
</div>
</div>
{{ else }}
<!-- <p>No table of contents available.</p> -->
{{ end }}
{{ end }}
1 change: 0 additions & 1 deletion layouts/events/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ <h1 style="text-align:left; font-size: xx-large;color:black;">{{ .Params.title }
<div class="accordion" id="markdownToc">
{{ .TableOfContents }}
</div>
<hr aria-hidden="true">
</div>
{{ else }}
<!-- <p>No table of contents available.</p> -->
Expand Down
1 change: 0 additions & 1 deletion layouts/news/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ <h1 style="text-align:left; font-size: xx-large; color:black;">{{ .Params.title
<div class="accordion" id="markdownToc">
{{ .TableOfContents }}
</div>
<hr aria-hidden="true">
</div>
{{ else }}
<!-- <p>No table of contents available.</p> -->
Expand Down
14 changes: 13 additions & 1 deletion static/css/style6Events.css
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 3d84d96

Please sign in to comment.