Hang margin notes on the title and keep each to one paragraph
This commit is contained in:
@@ -4,18 +4,6 @@
|
||||
窄屏:以虚线框内嵌在文章中。
|
||||
用法:{{< note >}}注释内容{{< /note >}}
|
||||
书目:{{< note cite >}}每行一项,各占一行{{< /note >}}
|
||||
渲染逻辑在 layouts/_partials/note.html,标题边注(titleNote)共用同一套。
|
||||
*/ -}}
|
||||
{{- $class := .Get 0 | default "" -}}
|
||||
{{- $page := .Page -}}
|
||||
{{- $n := add ($page.Store.Get "noteCount" | default 0) 1 -}}
|
||||
{{- $page.Store.Set "noteCount" $n -}}
|
||||
<span class="post-note-anchor" aria-hidden="true"></span><sup class="post-note-mark">{{ $n }}</sup><span class="post-note{{ with $class }} {{ . }}{{ end }}"><span class="post-note-num">{{ $n }}</span>{{- with .Inner -}}
|
||||
{{- if eq $class "cite" -}}
|
||||
{{- range split (trim . "\r\n") "\n" -}}
|
||||
{{- $line := trim . "\r" -}}
|
||||
{{- if ne (trim $line " ") "" -}}<span class="note-line">{{ $line | $page.RenderString (dict "display" "inline") }}</span>{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- . | $page.RenderString (dict "display" "inline") -}}
|
||||
{{- end -}}
|
||||
{{- end -}}</span>
|
||||
{{- partial "note.html" (dict "page" .Page "class" (.Get 0 | default "") "inner" .Inner) -}}
|
||||
Reference in New Issue
Block a user