Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,43 @@ html {
h1{
margin-bottom: 0;
}

/* Sidebar Layout */
.content-wrapper {
display: flex;
flex-direction: column;
}

@media screen and (min-width: 1200px) {
body {
max-width: 80vw;
}

.content-wrapper {
flex-direction: row;
align-items: stretch;
gap: 2rem;
}

.main-content {
flex: 1;
min-width: 0;
}

.toc-sidebar {
width: 250px;
flex-shrink: 0;
order: 2;
border-left: 1px solid var(--border);
padding-left: 1rem;
font-size: 0.9em;
}

.toc-sticky {
position: sticky;
top: 50%;
transform: translateY(-50%);
max-height: 90vh;
overflow-y: auto;
}
}
34 changes: 20 additions & 14 deletions layouts/learn.shtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,27 @@
</head>
<body id="body">
<h1 :text="$page.title"></h1>
<div class="docs" :if="$page.custom.getOr('toc', true).and($page.isSection().not()).and($page.toc().len().gt(11))">
<h1>Table of Contents</h1>
<div :html="$page.toc()"></div>
</div>
<div :html="$page.content()"></div>
<div id="prev-next" :if="$page.isSection().not()">
<div :if="$page.prevPage?()">
<a href="$if.link()">
<span :text="$if.title"></span>
</a>
<div class="content-wrapper">
<div class="toc-sidebar" :if="$page.custom.getOr('toc', true).and($page.isSection().not()).and($page.toc().len().gt(11))">
<div class="toc-sticky">
<h3>TOC</h3>
<div :html="$page.toc()"></div>
</div>
</div>
<div :if="$page.nextPage?()">
<a href="$if.link()">
<span :text="$if.title"></span>
</a>
<div class="main-content">
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main-content div is missing the id="content" attribute in the learn.shtml template, while it is present in content.shtml. This inconsistency could cause issues if there's JavaScript or CSS targeting the #content selector, and breaks the pattern established in content.shtml for Zine compatibility as mentioned in the PR description.

Suggested change
<div class="main-content">
<div id="content" class="main-content">

Copilot uses AI. Check for mistakes.
<div :html="$page.content()"></div>
<div id="prev-next" :if="$page.isSection().not()">
<div :if="$page.prevPage?()">
<a href="$if.link()">
<span :text="$if.title"></span>
</a>
</div>
<div :if="$page.nextPage?()">
<a href="$if.link()">
<span :text="$if.title"></span>
</a>
</div>
</div>
</div>
</div>
</body>
4 changes: 2 additions & 2 deletions layouts/monthly.shtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<extend template="content.shtml">
<head id="head">
</head>
<body id="body">
<div id="content">
<div :html="$page.content()"></div>
</body>
</div>
4 changes: 2 additions & 2 deletions layouts/page.shtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<extend template="content.shtml">
<head id="head">
</head>
<body id="body">
<div id="content">
<div :html="$page.content()"></div>
</body>
</div>
4 changes: 2 additions & 2 deletions layouts/post.shtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
<script defer src="https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/mermaid/8.14.0/mermaid.min.js" integrity="sha512-vLumCjg7NKEQKGM+xAgBYTvQ90DVu6Eo7vS1T/iPf2feNLcrpGxvumuUUmE3CPiCUPgviyKbtpWGDbhnVnmJxg==" onload="mermaid.initialize({startOnLoad:true});"></script>
</ctx>
</head>
<body id="body">
<div id="content">
<div :html="$page.content()"></div>
</body>
</div>
34 changes: 20 additions & 14 deletions layouts/templates/content.shtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,27 @@
</a>
</li>
</ul>
<div class="docs" :if="$page.custom.getOr('toc', true).and($page.isSection().not())">
<h1>TOC</h1>
<div :html="$page.toc()"></div>
</div>
<super>
<div id="prev-next" :if="$page.isSection().not()">
<div :if="$page.prevPage?()">
<a href="$if.link()">
<span :text="$if.title"></span>
</a>
<div class="content-wrapper">
<div class="toc-sidebar" :if="$page.custom.getOr('toc', true).and($page.isSection().not())">
<div class="toc-sticky">
<h3>TOC</h3>
<div :html="$page.toc()"></div>
</div>
</div>
<div :if="$page.nextPage?()">
<a href="$if.link()">
<span :text="$if.title"></span>
</a>
<div class="main-content" id="content">
<super>
<div id="prev-next" :if="$page.isSection().not()">
<div :if="$page.prevPage?()">
<a href="$if.link()">
<span :text="$if.title"></span>
</a>
</div>
<div :if="$page.nextPage?()">
<a href="$if.link()">
<span :text="$if.title"></span>
</a>
</div>
</div>
</div>
</div>
</body>