Add margin notes: Tufte-style side notes with dashed inline fallback

This commit is contained in:
2026-11-15 10:04:32 +08:00
parent 88c8c36d02
commit cfe85f9b16
6 changed files with 188 additions and 8 deletions
+6 -3
View File
@@ -1,13 +1,16 @@
{{ define "main" }}
<div class="hx:mx-auto hx:flex hextra-max-page-width">
{{- /* 有边注的页面:宽屏两侧需要留白,因此去掉 TOC 与侧栏占位 */ -}}
{{- $hasNotes := .HasShortcode "note" }}
<div class="hx:mx-auto hx:flex hextra-max-page-width{{ if $hasNotes }} has-notes{{ end }}">
{{ partial "sidebar.html" (dict "context" . "disableSidebar" true
"displayPlaceholder" true) }} {{ partial "toc.html" . }}
"displayPlaceholder" (not $hasNotes)) }} {{ if not $hasNotes }}{{ partial
"toc.html" . }}{{ end }}
<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"
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 }}"
>
{{ partial "breadcrumb.html" (dict "page" . "enable" true) }} {{ if
.Title }}