Add margin notes: Tufte-style side notes with dashed inline fallback
This commit is contained in:
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user