Rework Notes page: balanced two columns, filter, bibliography section, drop prev/next links
This commit is contained in:
1 parent
0699938cd5
commit
2490e8bbb1
10 files changed
+364
-30
No files matched your search
@@ -0,0 +1,13 @@
|
||||
{{- $p := . -}}
|
||||
{{- $raw := $p.RawContent -}}
|
||||
{{- $author := $p.Params.ref_author | default "" -}}
|
||||
{{- if not $author }}{{ with findRE `(?m)^Author\(s\)\r?\n: (.+)$` $raw 1 }}{{ $author = replaceRE `^Author\(s\)\r?\n: ` "" (index . 0) }}{{ end }}{{ end -}}
|
||||
{{- $author = $author | replaceRE `&` "&" | strings.TrimSpace -}}
|
||||
{{- $year := $p.Params.ref_year | default "" -}}
|
||||
{{- if not $year }}{{ with findRE `(?m)^Year\r?\n: (\d{4})` $raw 1 }}{{ $year = replaceRE `^Year\r?\n: ` "" (index . 0) }}{{ end }}{{ end -}}
|
||||
{{- $notes := slice -}}
|
||||
{{- range findRE `relref "[^"]+\.md"` $raw -}}
|
||||
{{- $base := . | replaceRE `^relref "(?:.*/)?([^"/]+)\.md"$` "$1" -}}
|
||||
{{- with site.GetPage (printf "/zettels/%s" $base) }}{{ $notes = $notes | append . }}{{ end -}}
|
||||
{{- end -}}
|
||||
{{- return (dict "author" $author "year" (string $year) "notes" $notes) -}}
|
||||
Reference in new issue
Block a user