From cc1220bfd794dff1fc28bd39cafb63c4b1093cf8 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Appel Date: Mon, 25 Dec 2023 17:17:21 -0500 Subject: rewrite layouts --- layouts/_default/baseof.html | 31 +++++++++++++++++++ layouts/_default/list.html | 23 ++++++++++++++ layouts/blog/list.html | 17 +++++++++++ layouts/blog/single.html | 14 +++++++++ layouts/index.html | 49 ++++++++++++++++++++++++++++++ layouts/partials/adaptive_details.html | 26 ++++++++++++++++ layouts/partials/card.html | 53 +++++++++++++++++++++++++++++++++ layouts/partials/card/date.html | 13 ++++++++ layouts/partials/card/full_summary.html | 7 +++++ layouts/partials/categories.html | 5 ++++ layouts/partials/footer.html | 2 ++ layouts/partials/header.html | 10 +++++++ layouts/partials/katex.html | 22 ++++++++++++++ layouts/partials/links/email.html | 5 ++++ layouts/partials/links/github.html | 5 ++++ layouts/partials/links/link.html | 6 ++++ layouts/partials/links/linkedin.html | 5 ++++ layouts/partials/links/site.html | 5 ++++ layouts/partials/meta-tag_nav.html | 13 ++++++++ layouts/partials/section_preview.html | 4 +++ layouts/partials/tags.html | 5 ++++ layouts/projects/list.html | 17 +++++++++++ layouts/projects/single.html | 12 ++++++++ layouts/research/list.html | 18 +++++++++++ layouts/research/single.html | 15 ++++++++++ layouts/shortcodes/presentations.html | 3 ++ layouts/shortcodes/publications.html | 3 ++ layouts/utilities/list.html | 17 +++++++++++ layouts/utilities/single.html | 18 +++++++++++ 29 files changed, 423 insertions(+) create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/blog/list.html create mode 100644 layouts/blog/single.html create mode 100644 layouts/index.html create mode 100644 layouts/partials/adaptive_details.html create mode 100644 layouts/partials/card.html create mode 100644 layouts/partials/card/date.html create mode 100644 layouts/partials/card/full_summary.html create mode 100644 layouts/partials/categories.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/katex.html create mode 100644 layouts/partials/links/email.html create mode 100644 layouts/partials/links/github.html create mode 100644 layouts/partials/links/link.html create mode 100644 layouts/partials/links/linkedin.html create mode 100644 layouts/partials/links/site.html create mode 100644 layouts/partials/meta-tag_nav.html create mode 100644 layouts/partials/section_preview.html create mode 100644 layouts/partials/tags.html create mode 100644 layouts/projects/list.html create mode 100644 layouts/projects/single.html create mode 100644 layouts/research/list.html create mode 100644 layouts/research/single.html create mode 100644 layouts/shortcodes/presentations.html create mode 100644 layouts/shortcodes/publications.html create mode 100644 layouts/utilities/list.html create mode 100644 layouts/utilities/single.html (limited to 'layouts') diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..8c47b26 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,31 @@ + + + + + + {{ .Title }} + + + {{ if .Params.math }} + {{- partial "katex.html" . -}} + {{ end }} + + +
+ {{- partial "header.html" . -}} + {{- block "header" . }} +

{{ .Title | markdownify }}

+ {{- end }} +
+
+ {{- block "main" . }} + {{ .Content }} + {{- end }} +
+
+ + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..e65e0a3 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,23 @@ +{{ define "header" }} +

{{ .Title | markdownify }}

+{{ end }} +{{ define "main" }} + + {{ .Content }} + + + {{ $cardConfig := dict + "fullSummary" false + "showMeta" false + "showTags" false + "showCategories" false + }} + {{ range sort .Pages "Params.end_date" "desc" }} + {{ .Scratch.Set "cardConfig" $cardConfig }} + {{ partial "card.html" . }} + {{ end }} + +{{ end }} +{{ define "footer" }} +{{ partial "meta-tag_nav.html" . }} +{{ end }} diff --git a/layouts/blog/list.html b/layouts/blog/list.html new file mode 100644 index 0000000..926b540 --- /dev/null +++ b/layouts/blog/list.html @@ -0,0 +1,17 @@ +{{ define "main" }} + + {{ .Content }} + + + {{ $cardConfig := dict + "fullSummary" false + "showMeta" true + "showTags" true + "showCategories" true + }} + {{ range sort .Pages "Params.end_date" "desc" }} + {{ .Scratch.Set "cardConfig" $cardConfig }} + {{ partial "card.html" . }} + {{ end }} + +{{ end }} diff --git a/layouts/blog/single.html b/layouts/blog/single.html new file mode 100644 index 0000000..05cc54f --- /dev/null +++ b/layouts/blog/single.html @@ -0,0 +1,14 @@ +{{ define "header" }} +

{{ .Title }}

+ +{{ end }} + +{{ define "main" }} +
+ {{ .Content }} +
+{{ end }} + +{{ define "footer" }} + {{ partial "meta-tag_nav.html" . }} +{{ end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..de37c3e --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,49 @@ +{{ define "header" }} + +{{ end }} +{{ define "main" }} + +
+
+

Projects

+
    + {{ range first 3 (where .Site.RegularPages "Section" "projects") }} + {{ partial "section_preview.html" . }} + {{ end }} +
+
+
+

Research

+
    + {{ range first 3 (where .Site.RegularPages "Section" "research") }} + {{ partial "section_preview.html" . }} + {{ end }} +
+
+
+

Blog

+
    + {{ range (where .Site.RegularPages "Section" "blog") }} + {{ partial "section_preview.html" . }} + {{ end }} +
+
+
+{{ end }} +{{ define "footer" }} + +{{ end }} diff --git a/layouts/partials/adaptive_details.html b/layouts/partials/adaptive_details.html new file mode 100644 index 0000000..2180325 --- /dev/null +++ b/layouts/partials/adaptive_details.html @@ -0,0 +1,26 @@ + diff --git a/layouts/partials/card.html b/layouts/partials/card.html new file mode 100644 index 0000000..c451066 --- /dev/null +++ b/layouts/partials/card.html @@ -0,0 +1,53 @@ +{{ $cardConfig := .Scratch.Get "cardConfig" }} +
+ +
  • +
    +

    {{ .LinkTitle }}

    +

    {{ partial "card/date.html" . }}

    + {{ if $cardConfig.fullSummary }} + {{ partial "card/full_summary.html" . }} + {{ else }} +

    {{ .Summary }}

    + {{ end }} +
    + + {{ with .Resources.GetMatch .Params.thumbnail }} + {{ $image := .Fit "800x500" }} +
    + {{ .Name }} +
    + {{ else }} + {{ with .Resources.GetMatch "thumbnail.*" }} + {{ $image := .Fit "400x400" }} +
    + {{ $image.Name }} +
    + {{ end }} + {{ end }} +
  • +
    +{{ if $cardConfig.showMeta }} +
    + {{ with .Params.github }} + {{ partial "links/github.html" . }} + {{ end }} + {{ with .Params.link }} + {{ partial "links/link.html" . }} + {{ end }} + {{ with .Params.site }} + {{ partial "links/site.html" . }} + {{ end }} + {{ $hasMetaAttrs := or $cardConfig.showCategories $cardConfig.showTags }} + {{ if $hasMetaAttrs }} +
    + {{ if $cardConfig.showCategories }} + {{ partial "categories.html" . }} + {{ end }} + {{ if $cardConfig.showTags }} + {{ partial "tags.html" . }} + {{ end }} +
    + {{ end }} +{{ end }} +
    diff --git a/layouts/partials/card/date.html b/layouts/partials/card/date.html new file mode 100644 index 0000000..bcf1851 --- /dev/null +++ b/layouts/partials/card/date.html @@ -0,0 +1,13 @@ +{{ if .Params.start_date }} + {{ time.Format "January 2006" .Params.start_date }} + — + {{ if .Params.end_date }} + {{ time.Format "January 2006" .Params.end_date }} + {{ else }} + Present + {{ end }} +{{ else }} + {{ if .Date }} + {{ .Date.Format "January 2006" }} + {{ end }} +{{ end }} diff --git a/layouts/partials/card/full_summary.html b/layouts/partials/card/full_summary.html new file mode 100644 index 0000000..1230df6 --- /dev/null +++ b/layouts/partials/card/full_summary.html @@ -0,0 +1,7 @@ +
    + {{ .Params.summary }} + {{ if .Params.abstract }} +

    Abstract

    +

    {{ .Params.abstract }}

    + {{ end }} +
    diff --git a/layouts/partials/categories.html b/layouts/partials/categories.html new file mode 100644 index 0000000..fa48e5b --- /dev/null +++ b/layouts/partials/categories.html @@ -0,0 +1,5 @@ +{{ with .Params.categories }} + {{ range . }} + {{ title . }} + {{ end }} +{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..1057cac --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,2 @@ + +

    © {{ now.Format "2006" }} JP Appel

    diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..0128c2f --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,10 @@ + + diff --git a/layouts/partials/katex.html b/layouts/partials/katex.html new file mode 100644 index 0000000..e0468d2 --- /dev/null +++ b/layouts/partials/katex.html @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/layouts/partials/links/email.html b/layouts/partials/links/email.html new file mode 100644 index 0000000..87ddc8a --- /dev/null +++ b/layouts/partials/links/email.html @@ -0,0 +1,5 @@ + + + diff --git a/layouts/partials/links/github.html b/layouts/partials/links/github.html new file mode 100644 index 0000000..9cb2dbb --- /dev/null +++ b/layouts/partials/links/github.html @@ -0,0 +1,5 @@ + + + diff --git a/layouts/partials/links/link.html b/layouts/partials/links/link.html new file mode 100644 index 0000000..f45c0b9 --- /dev/null +++ b/layouts/partials/links/link.html @@ -0,0 +1,6 @@ + + + diff --git a/layouts/partials/links/linkedin.html b/layouts/partials/links/linkedin.html new file mode 100644 index 0000000..86efb09 --- /dev/null +++ b/layouts/partials/links/linkedin.html @@ -0,0 +1,5 @@ + + + diff --git a/layouts/partials/links/site.html b/layouts/partials/links/site.html new file mode 100644 index 0000000..58787ad --- /dev/null +++ b/layouts/partials/links/site.html @@ -0,0 +1,5 @@ + + + diff --git a/layouts/partials/meta-tag_nav.html b/layouts/partials/meta-tag_nav.html new file mode 100644 index 0000000..8e68c5c --- /dev/null +++ b/layouts/partials/meta-tag_nav.html @@ -0,0 +1,13 @@ + + diff --git a/layouts/partials/section_preview.html b/layouts/partials/section_preview.html new file mode 100644 index 0000000..c973b06 --- /dev/null +++ b/layouts/partials/section_preview.html @@ -0,0 +1,4 @@ +
  • + {{ .Title }} +

    {{ .Summary }}

    +
  • diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html new file mode 100644 index 0000000..9ca38af --- /dev/null +++ b/layouts/partials/tags.html @@ -0,0 +1,5 @@ +{{ with .Params.tags }} + {{ range . }} + {{ title . }} + {{ end }} +{{ end }} diff --git a/layouts/projects/list.html b/layouts/projects/list.html new file mode 100644 index 0000000..926b540 --- /dev/null +++ b/layouts/projects/list.html @@ -0,0 +1,17 @@ +{{ define "main" }} + + {{ .Content }} + + + {{ $cardConfig := dict + "fullSummary" false + "showMeta" true + "showTags" true + "showCategories" true + }} + {{ range sort .Pages "Params.end_date" "desc" }} + {{ .Scratch.Set "cardConfig" $cardConfig }} + {{ partial "card.html" . }} + {{ end }} + +{{ end }} diff --git a/layouts/projects/single.html b/layouts/projects/single.html new file mode 100644 index 0000000..8b86316 --- /dev/null +++ b/layouts/projects/single.html @@ -0,0 +1,12 @@ +{{ define "header" }} +

    {{ .Title }}

    + +{{ end }} + +{{ define "footer" }} + {{ partial "meta-tag_nav.html" . }} +{{ end }} diff --git a/layouts/research/list.html b/layouts/research/list.html new file mode 100644 index 0000000..db587e3 --- /dev/null +++ b/layouts/research/list.html @@ -0,0 +1,18 @@ +{{ define "main" }} + + {{ .Content }} + + + {{ $cardConfig := dict + "fullSummary" true + "showMeta" true + "showTags" true + "showCategories" true + }} + {{ range sort .Pages "Params.end_date" "desc" }} + {{ .Scratch.Set "cardConfig" $cardConfig }} + {{ partial "card.html" . }} + {{ end }} + + {{ partial "adaptive_details.html" . }} +{{ end }} diff --git a/layouts/research/single.html b/layouts/research/single.html new file mode 100644 index 0000000..01ecb9e --- /dev/null +++ b/layouts/research/single.html @@ -0,0 +1,15 @@ +{{ define "main" }} + {{ if .Params.abstract }} +
    +

    Abstract

    +
    + {{ .Params.abstract }} +
    +
    + {{ end }} + {{ .Content }} +{{ end }} + +{{ define "footer" }} + {{ partial "meta-tag_nav.html" . }} +{{ end }} diff --git a/layouts/shortcodes/presentations.html b/layouts/shortcodes/presentations.html new file mode 100644 index 0000000..0af2303 --- /dev/null +++ b/layouts/shortcodes/presentations.html @@ -0,0 +1,3 @@ +
    + {{ .Inner | markdownify }} +
    diff --git a/layouts/shortcodes/publications.html b/layouts/shortcodes/publications.html new file mode 100644 index 0000000..49a176c --- /dev/null +++ b/layouts/shortcodes/publications.html @@ -0,0 +1,3 @@ +
    + {{ .Inner | markdownify }} +
    diff --git a/layouts/utilities/list.html b/layouts/utilities/list.html new file mode 100644 index 0000000..3d4ebe0 --- /dev/null +++ b/layouts/utilities/list.html @@ -0,0 +1,17 @@ +{{ define "main" }} + {{ .Content }} + + + {{ $cardConfig := dict + "fullSummary" false + "showMeta" true + "showTags" false + "showCategories" false + }} + {{ range .Pages }} + {{ .Scratch.Set "cardConfig" $cardConfig }} + {{ partial "card.html" . }} + {{ end }} + + +{{ end }} diff --git a/layouts/utilities/single.html b/layouts/utilities/single.html new file mode 100644 index 0000000..7c377f5 --- /dev/null +++ b/layouts/utilities/single.html @@ -0,0 +1,18 @@ +{{ define "header" }} +

    {{ .Title }}

    + +{{ end }} + +{{ define "footer" }} + {{ partial "meta-tag_nav.html" . }} +{{ end }} -- cgit v1.2.3