From 590de1357a056a32f55370c3a87b713f7aa5da52 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Thu, 26 Oct 2023 20:36:51 +0100 Subject: [PATCH] feat: port Author Profile Block to Tailwind --- .../layouts/_default/list.html | 4 +- .../layouts/partials/page_author_card.html | 49 ++++++++++++++----- .../layouts/partials/page_footer.html | 2 +- .../layouts/partials/social_links.html | 29 ++++++----- .../layouts/partials/views/card.html | 4 +- 5 files changed, 57 insertions(+), 31 deletions(-) diff --git a/modules/wowchemy-tailwind/layouts/_default/list.html b/modules/wowchemy-tailwind/layouts/_default/list.html index 277f4362..9b39602d 100644 --- a/modules/wowchemy-tailwind/layouts/_default/list.html +++ b/modules/wowchemy-tailwind/layouts/_default/list.html @@ -22,8 +22,8 @@ {{end}}
-
{{ .Title }}
-

+

{{ .Title }}
+

{{ (.Params.summary | default .Summary) | plainify | htmlUnescape | chomp -}}

diff --git a/modules/wowchemy-tailwind/layouts/partials/page_author_card.html b/modules/wowchemy-tailwind/layouts/partials/page_author_card.html index 06027aa8..ce59735c 100644 --- a/modules/wowchemy-tailwind/layouts/partials/page_author_card.html +++ b/modules/wowchemy-tailwind/layouts/partials/page_author_card.html @@ -12,19 +12,46 @@ {{ end }} {{ $avatar := ($author_page.Resources.ByType "image").GetMatch "*avatar*" }} {{ $avatar_shape := site.Params.features.avatar.shape | default "circle" }} -

- {{ if and site.Params.features.avatar.gravatar $author_page.Params.email }} - {{if $profile_url}}{{end}}{{$author_page.Title}}{{if $profile_url}}{{end}} - {{ else if $avatar }} - {{ $avatar_image := $avatar.Fill "270x270 Center" }} - {{if $profile_url}}{{end}}{{$author_page.Title}}{{if $profile_url}}{{end}} + +
+ {{ if $avatar }} + {{ $authorImage := $avatar.Fill "192x192 Center" }} + {{$author_page.Title}} + {{ end }} +
+
+ {{ i18n "authors" }} +
+ + + {{ with $author_page.Params.role }} +
+ {{. | markdownify | emojify}} +
+ {{end}} + + + {{ with $author_page.Params.bio }} +
{{ . | markdownify | emojify }}
{{ end }} -
-
{{if $profile_url}}{{end}}{{$author_page.Title}}{{if $profile_url}}{{end}}
- {{ with $author_page.Params.role }}
{{. | markdownify | emojify}}
{{end}} - {{ with $author_page.Params.bio }}

{{. | markdownify | emojify}}

{{end}} +
+ {{ partial "social_links" $author_page }} +
-{{end}}{{/* Profile page block */}} +
+ +{{end}}{{/* End Check for Author Profile */}} diff --git a/modules/wowchemy-tailwind/layouts/partials/page_footer.html b/modules/wowchemy-tailwind/layouts/partials/page_footer.html index b5a62e97..0661dd87 100644 --- a/modules/wowchemy-tailwind/layouts/partials/page_footer.html +++ b/modules/wowchemy-tailwind/layouts/partials/page_footer.html @@ -1,7 +1,7 @@ {{ partial "page_edit" . }} {{ partial "tags" . }} {{/* partial "components/page_sharer" . */}} -{{/* partial "page_author" . */}} +{{ partial "page_author" . }} {{ partial "comments" . }} {{ if .Params.pager }} diff --git a/modules/wowchemy-tailwind/layouts/partials/social_links.html b/modules/wowchemy-tailwind/layouts/partials/social_links.html index 78de30af..81786e32 100644 --- a/modules/wowchemy-tailwind/layouts/partials/social_links.html +++ b/modules/wowchemy-tailwind/layouts/partials/social_links.html @@ -1,22 +1,21 @@ - + {{ partial "functions/get_icon" (dict "name" .icon "attributes" "height=\"1em\"") }} + {{ end }} +
+{{ end }} diff --git a/modules/wowchemy-tailwind/layouts/partials/views/card.html b/modules/wowchemy-tailwind/layouts/partials/views/card.html index c4ed55a8..edb1d2d2 100644 --- a/modules/wowchemy-tailwind/layouts/partials/views/card.html +++ b/modules/wowchemy-tailwind/layouts/partials/views/card.html @@ -13,8 +13,8 @@ {{end}}
-
{{ $item.Title }}
-

+

{{ $item.Title }}
+

{{ ($item.Params.summary | default $item.Summary) | plainify | htmlUnescape | chomp -}}