diff options
| author | tdro <tdro@noreply.example.com> | 2024-06-13 00:00:00 +0000 |
|---|---|---|
| committer | tdro <tdro@noreply.example.com> | 2024-06-13 00:00:00 +0000 |
| commit | 912c7fee89e38ae2fa5b2c539215948162c4d9e8 (patch) | |
| tree | 66a53c17a7a4aeb5983a0e13ae8c742a3e53f9e3 | |
| parent | 1c848351cc19aa66c96f78161e6909c6b751b8d4 (diff) | |
| download | canory-912c7fee89e38ae2fa5b2c539215948162c4d9e8.tar.gz canory-912c7fee89e38ae2fa5b2c539215948162c4d9e8.tar.bz2 canory-912c7fee89e38ae2fa5b2c539215948162c4d9e8.zip | |
themes/default/layouts/_default/home.authors: Parameterize
4 files changed, 20 insertions, 8 deletions
diff --git a/themes/default/layouts/_default/home.authors.html b/themes/default/layouts/_default/home.authors.html index 821e60e..5bb609a 100644 --- a/themes/default/layouts/_default/home.authors.html +++ b/themes/default/layouts/_default/home.authors.html @@ -22,7 +22,12 @@ {{- define "middle" -}} {{- partial "generate-authors" . -}} - {{- partial "author-data.html" . -}} + {{- partial "author-data.html" + (dict + "Context" . + "Authors" (partial "function-authors-slice.html" .) + ) + -}} {{- end -}} {{- define "right" -}} diff --git a/themes/default/layouts/_default/home.authors.section.html b/themes/default/layouts/_default/home.authors.section.html index 230892c..b7b39c2 100644 --- a/themes/default/layouts/_default/home.authors.section.html +++ b/themes/default/layouts/_default/home.authors.section.html @@ -1 +1,6 @@ -{{- partial "author-data.html" . -}} + {{- partial "author-data.html" + (dict + "Context" . + "Authors" (first 3 (partial "function-authors-slice.html" .)) + ) + -}} diff --git a/themes/default/layouts/partials/author-card.html b/themes/default/layouts/partials/author-card.html index 1fcfb72..80a1629 100644 --- a/themes/default/layouts/partials/author-card.html +++ b/themes/default/layouts/partials/author-card.html @@ -1,4 +1,4 @@ -{{- $host := (urls.Parse $.Site.BaseURL).Host -}} +{{- $host := (urls.Parse ("" | absURL)).Host -}} {{- $date := .Date | time.Format "Mon Jan 2 2006" -}} {{- $metadata := print "public/" .Data.user "/author.json" -}} diff --git a/themes/default/layouts/partials/author-data.html b/themes/default/layouts/partials/author-data.html index 60a6cfb..985cbfd 100644 --- a/themes/default/layouts/partials/author-data.html +++ b/themes/default/layouts/partials/author-data.html @@ -1,17 +1,19 @@ -{{- $authors := partial "function-authors-slice.html" . -}} +{{- $authors := .Authors -}} +{{- $pageContext := .Context -}} + {{- $modified := partial "function-page-modified.html" (dict - "Context" . + "Context" $pageContext "Disable" true ) -}} {{- if $modified -}} - {{- range $author := first 3 $authors -}} - {{- $recent := where $.Site.RegularPages.ByDate.Reverse "Section" $author -}} + {{- range $author := $authors -}} + {{- $recent := where $pageContext.Site.RegularPages.ByDate.Reverse "Section" $author -}} {{- $recent = where $recent "Params.feed" "eq" nil -}} - {{- $data := index $.Site.Data.authors $author -}} + {{- $data := index $pageContext.Site.Data.authors $author -}} {{- $date := or (index (first 1 ($recent)) 0).Date 0 -}} {{- partial "author-card.html" (dict |
