Notes: keep TOC/layout intact, place notes in page margins with adaptive width

This commit is contained in:
2026-11-15 10:14:44 +08:00
parent cfe85f9b16
commit cbe7417fbf
4 changed files with 68 additions and 46 deletions
+3 -6
View File
@@ -1,16 +1,13 @@
{{ define "main" }}
{{- /* 有边注的页面:宽屏两侧需要留白,因此去掉 TOC 与侧栏占位 */ -}}
{{- $hasNotes := .HasShortcode "note" }}
<div class="hx:mx-auto hx:flex hextra-max-page-width{{ if $hasNotes }} has-notes{{ end }}">
<div class="hx:mx-auto hx:flex hextra-max-page-width">
{{ partial "sidebar.html" (dict "context" . "disableSidebar" true
"displayPlaceholder" (not $hasNotes)) }} {{ if not $hasNotes }}{{ partial
"toc.html" . }}{{ end }}
"displayPlaceholder" true) }} {{ partial "toc.html" . }}
<article
class="hx:w-full hx:break-words hx:flex hx:min-h-[calc(100vh-var(--navbar-height))] hx:min-w-0 hx:justify-center hx:pb-8 hx:pr-[calc(env(safe-area-inset-right)-1.5rem)]"
>
<main
id="content"
class="hx:w-full hx:min-w-0 hextra-max-content-width hx:px-6 hx:pt-0 hx:md:px-12{{ if $hasNotes }} notes-page{{ end }}"
class="hx:w-full hx:min-w-0 hextra-max-content-width hx:px-6 hx:pt-0 hx:md:px-12"
>
{{ partial "breadcrumb.html" (dict "page" . "enable" true) }} {{ if
.Title }}