From 903fc49fd65061dc6ffdee6fbd3678df15c0c235 Mon Sep 17 00:00:00 2001 From: yequari Date: Sun, 5 May 2024 21:43:38 -0700 Subject: [PATCH] add notes page w custom layout, separate css files --- config.yaml | 7 ++++-- layouts/notes/list.html | 26 +++++++++++++++++++++ layouts/notes/single.html | 11 +++++++++ layouts/partials/css.html | 2 ++ themes/dreamcast/layouts/partials/css.html | 1 + themes/dreamcast/layouts/partials/head.html | 2 +- 6 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 layouts/notes/list.html create mode 100644 layouts/notes/single.html create mode 100644 layouts/partials/css.html create mode 100644 themes/dreamcast/layouts/partials/css.html diff --git a/config.yaml b/config.yaml index 1f9d7a6..3163a6d 100644 --- a/config.yaml +++ b/config.yaml @@ -26,12 +26,15 @@ menu: - name: Projects pageRef: /projects weight: 30 + - name: Notes + pageRef: /notes + weight: 40 - name: Now pageRef: /now - weight: 40 + weight: 50 - name: Links pageRef: /links - weight: 50 + weight: 60 social: - name: yequari@retro.pizza params: diff --git a/layouts/notes/list.html b/layouts/notes/list.html new file mode 100644 index 0000000..02448ed --- /dev/null +++ b/layouts/notes/list.html @@ -0,0 +1,26 @@ +{{ define "main" }} +

{{ .Title }}

+{{ .Content }} +
+ {{ $taxonomy := "tags" }} + {{ $section := "notes" }} + {{ range $term, $weightedPages := index site.Taxonomies $taxonomy }} + {{ $termPage := site.GetPage (printf "%s/%s" $taxonomy $term) }} + + {{ $termPages := where $weightedPages "Page.Section" $section }} + {{ $amount := $termPages.Len }} + {{ if gt $amount 0 }} +
+

{{ $termPage.LinkTitle }}

+
    + {{ range sort $termPages "Page.Title" }} +
  • + {{ .LinkTitle }} +
  • + {{ end }} +
+
+ {{ end }} + {{ end }} +
+{{ end }} diff --git a/layouts/notes/single.html b/layouts/notes/single.html new file mode 100644 index 0000000..d5cbb41 --- /dev/null +++ b/layouts/notes/single.html @@ -0,0 +1,11 @@ +{{ define "main" }} +

{{ .Title }}

+
+
+ {{ partial "tags.html" .}} +
+ {{ .Content }} +
+
+
+{{ end }} diff --git a/layouts/partials/css.html b/layouts/partials/css.html new file mode 100644 index 0000000..c91f302 --- /dev/null +++ b/layouts/partials/css.html @@ -0,0 +1,2 @@ + + diff --git a/themes/dreamcast/layouts/partials/css.html b/themes/dreamcast/layouts/partials/css.html new file mode 100644 index 0000000..b46e78e --- /dev/null +++ b/themes/dreamcast/layouts/partials/css.html @@ -0,0 +1 @@ + diff --git a/themes/dreamcast/layouts/partials/head.html b/themes/dreamcast/layouts/partials/head.html index 99b03bb..c38bfe8 100644 --- a/themes/dreamcast/layouts/partials/head.html +++ b/themes/dreamcast/layouts/partials/head.html @@ -8,7 +8,7 @@ {{ .Page.Title }} - + {{ partial "css.html" . }}