From 9135a41cd6f8fbdca897526c8b58175ff800d760 Mon Sep 17 00:00:00 2001 From: desmukh Date: Tue, 27 Dec 2022 12:19:29 +0500 Subject: [PATCH] writing: add accordion functionality --- layouts/partials/accordion-script.html | 16 +++++++++++ layouts/partials/essay-accordion.html | 14 +++++----- layouts/partials/head.html | 37 ++++++++++++++++++++++++++ layouts/writing/list.html | 1 + 4 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 layouts/partials/accordion-script.html create mode 100644 layouts/partials/head.html diff --git a/layouts/partials/accordion-script.html b/layouts/partials/accordion-script.html new file mode 100644 index 0000000..7760184 --- /dev/null +++ b/layouts/partials/accordion-script.html @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/layouts/partials/essay-accordion.html b/layouts/partials/essay-accordion.html index 93ebe8a..a643b9d 100644 --- a/layouts/partials/essay-accordion.html +++ b/layouts/partials/essay-accordion.html @@ -1,6 +1,8 @@ -

{{ .year }}

-{{ range where .essays "year" .year }} -
-

{{ .year }}. {{ .title }}, {{ .publication }}, {{ .date }}.

-
-{{ end }} \ No newline at end of file + +
+ {{ range where .essays "year" .year }} +
+

{{ .title }}, {{ .publication }}, {{ .date }}.

+
+ {{ end }} +
\ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..b04d33c --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,37 @@ + + + + {{ $title := print .Site.Title " | " .Title }} + {{ if .IsHome }}{{ $title = .Site.Title }}{{ end }} + {{/* scss compiling */}} + {{ $options := (dict "targetPath" "css/style.css" "outputStyle" "compressed") }} + {{ $style := resources.Get "scss/main.scss" | resources.ToCSS $options }} + {{ template "_internal/twitter_cards.html" . }} + + {{ $title }} + {{- partial "octocss.html" . -}} + {{ if eq .Title "Writing" }} + + {{ end }} + diff --git a/layouts/writing/list.html b/layouts/writing/list.html index 625b344..866e75b 100644 --- a/layouts/writing/list.html +++ b/layouts/writing/list.html @@ -13,6 +13,7 @@ {{ partial "essay-accordion" (dict "essays" .Params.Essays "year" 2019)}} {{ partial "essay-accordion" (dict "essays" .Params.Essays "year" 2018)}} {{ partial "essay-accordion" (dict "essays" .Params.Essays "year" 2017)}} + {{ partial "accordion-script"}}