diff --git a/content/bibliography/_index.md b/content/bibliography/_index.md index e69de29..7c14d58 100644 --- a/content/bibliography/_index.md +++ b/content/bibliography/_index.md @@ -0,0 +1,4 @@ ++++ +title = "Bibliography" +build = { render = "never", list = "never" } ++++ diff --git a/content/zettels/_index.md b/content/zettels/_index.md index c2a149d..37fb7c9 100644 --- a/content/zettels/_index.md +++ b/content/zettels/_index.md @@ -1,8 +1,11 @@ +++ -title = "Zettels" +title = "Notes" author = ["Thomas Dehaeze"] type = "zettels" +url = "/notes/" draft = false +++ -Here is the list of subjects I took note about. +Technical notes on control, mechatronics, instrumentation and related topics. +This is a living personal wiki, so some notes are still incomplete. +Further down, there is a list of notes on books, theses and articles I have read and found interesting. diff --git a/layouts/article/single.html b/layouts/article/single.html new file mode 100644 index 0000000..1d0659f --- /dev/null +++ b/layouts/article/single.html @@ -0,0 +1,34 @@ +{{ define "content" -}} +
+ +
+

{{ .Title | title }}

+
+ + + {{- partial "post/toc.html" . -}} + + +
+ {{ .Content }} +
+ + + {{ partial "backlinks" . }} + + +
+
+ {{ partial "comments.html" $ }} +
+{{- end }} diff --git a/layouts/book/single.html b/layouts/book/single.html new file mode 100644 index 0000000..1d0659f --- /dev/null +++ b/layouts/book/single.html @@ -0,0 +1,34 @@ +{{ define "content" -}} +
+ +
+

{{ .Title | title }}

+
+ + + {{- partial "post/toc.html" . -}} + + +
+ {{ .Content }} +
+ + + {{ partial "backlinks" . }} + + +
+
+ {{ partial "comments.html" $ }} +
+{{- end }} diff --git a/layouts/inbook/single.html b/layouts/inbook/single.html new file mode 100644 index 0000000..1d0659f --- /dev/null +++ b/layouts/inbook/single.html @@ -0,0 +1,34 @@ +{{ define "content" -}} +
+ +
+

{{ .Title | title }}

+
+ + + {{- partial "post/toc.html" . -}} + + +
+ {{ .Content }} +
+ + + {{ partial "backlinks" . }} + + +
+
+ {{ partial "comments.html" $ }} +
+{{- end }} diff --git a/layouts/partials/notes/bibmeta.html b/layouts/partials/notes/bibmeta.html new file mode 100644 index 0000000..d931c63 --- /dev/null +++ b/layouts/partials/notes/bibmeta.html @@ -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) -}} diff --git a/layouts/partials/notes/styles.html b/layouts/partials/notes/styles.html new file mode 100644 index 0000000..03f68a7 --- /dev/null +++ b/layouts/partials/notes/styles.html @@ -0,0 +1,68 @@ + + diff --git a/layouts/phdthesis/single.html b/layouts/phdthesis/single.html new file mode 100644 index 0000000..1d0659f --- /dev/null +++ b/layouts/phdthesis/single.html @@ -0,0 +1,34 @@ +{{ define "content" -}} +
+ +
+

{{ .Title | title }}

+
+ + + {{- partial "post/toc.html" . -}} + + +
+ {{ .Content }} +
+ + + {{ partial "backlinks" . }} + + +
+
+ {{ partial "comments.html" $ }} +
+{{- end }} diff --git a/layouts/zettels/list.html b/layouts/zettels/list.html index 4cc600d..7f5e152 100644 --- a/layouts/zettels/list.html +++ b/layouts/zettels/list.html @@ -1,44 +1,109 @@ -{{- define "title" }}{{ T "archive" }} - {{ .Site.Title }}{{ end -}} +{{- define "title" }}{{ .Title }} - {{ .Site.Title }}{{ end -}} {{- define "item" -}} -
  • +
  • {{ .Title | title }} - {{ with .Keywords }}{{ . }}{{ end }} + {{ with .Keywords }}{{ delimit . ", " }}{{ end }} {{ with .Description }}
    {{ . }}
    {{ end }}
  • {{- end }} -{{- define "content" }} -{{- range .Pages.GroupByParam "category" }} -
    - {{ .Key | title }}: +{{- define "card" -}} +{{- $id := .Key | urlize }} +
    +

    {{ .Key | title }} {{ len .Pages }}

    + {{- $plain := where .Pages "Params.subcategory" "eq" nil }} + {{- if $plain }} + {{- end }} + {{- range (where .Pages "Params.subcategory" "ne" nil).GroupByParam "subcategory" }} +
    +

    {{ .Key | title }} ({{ len .Pages }})

    +
      + {{- range .Pages.ByTitle }}{{ template "item" . }}{{ end }} +
    +
    + {{- end }} +
    +{{- end }} + +{{- define "bibcard" -}} +{{- $label := .label }} +
    +

    {{ $label }} {{ len .pages }}

    + {{- $rows := slice }} + {{- range .pages }}{{ $m := partial "notes/bibmeta.html" . }}{{ $rows = $rows | append (dict "page" . "m" $m "year" (or $m.year "0")) }}{{ end }} +
    {{- end }} +{{- define "content" }} +{{- partial "notes/styles.html" . }} +{{- $cats := .Pages.GroupByParam "category" }} {{- $uncat := where .Pages "Params.category" "eq" nil }} -{{- if $uncat }} -
    - Other: - -
    -{{- end }} + {{- if $uncat }}{{ $groups = $groups | append (dict "Key" "Other" "Pages" $uncat "w" (add (len $uncat) 3)) }}{{ end }} + {{- $colA := slice }}{{ $colB := slice }}{{ $wA := 0 }}{{ $wB := 0 }} + {{- range sort $groups "w" "desc" }} + {{- if le $wA $wB }}{{ $colA = $colA | append . }}{{ $wA = add $wA .w }} + {{- else }}{{ $colB = $colB | append . }}{{ $wB = add $wB .w }}{{ end }} + {{- end }} +
    +
    {{ range sort $colA "Key" }}{{ template "card" . }}{{ end }}
    +
    {{ range sort $colB "Key" }}{{ template "card" . }}{{ end }}
    +
    +
    + +
    +

    Bibliography {{ $bibCount }}

    +
    + {{- range $bibTypes }}{{ if .pages }}{{ template "bibcard" (dict "label" .label "pages" .pages.ByTitle) }}{{ end }}{{ end }} +
    +
    + + + {{- end }} diff --git a/layouts/zettels/single.html b/layouts/zettels/single.html new file mode 100644 index 0000000..3a5f00a --- /dev/null +++ b/layouts/zettels/single.html @@ -0,0 +1,45 @@ +{{ define "content" -}} +
    +
    +

    {{ .Title }}

    +
    + + {{- partial "post/toc.html" . -}} + +
    + {{ .Content }} +
    + + {{- $base := .File.BaseFileName }} + {{- $needle := printf `/%s.md"` $base }} + {{- $needle2 := printf `"%s.md"` $base }} + {{- $refs := slice }} + {{- range where site.RegularPages "Section" "in" (slice "book" "article" "phdthesis" "inproceedings" "inbook" "techreport") }} + {{- if or (strings.Contains .RawContent (printf `relref "%s.md"` $base)) (strings.Contains .RawContent (printf `/%s.md"` $base)) }}{{ $refs = $refs | append . }}{{ end }} + {{- end }} + {{- with $refs }} +
    +

    References

    + +
    + {{- end }} + + {{ partial "backlinks" . }} + + +
    +
    + {{ partial "comments.html" $ }} +
    +{{- end }}