From 22b42c33390782729fef398ad8ac8fd0f95eef6f Mon Sep 17 00:00:00 2001 From: Beyza Nur Deniz Date: Sun, 1 Dec 2024 22:55:02 +0300 Subject: [PATCH] research areas card --- layouts/shortcodes/people_with_areas.html | 69 +++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 layouts/shortcodes/people_with_areas.html diff --git a/layouts/shortcodes/people_with_areas.html b/layouts/shortcodes/people_with_areas.html new file mode 100644 index 0000000..da95ef4 --- /dev/null +++ b/layouts/shortcodes/people_with_areas.html @@ -0,0 +1,69 @@ +{{ $ctx := newScratch }} + +{{ $tag := .Get "tag" }} +{{ $columns := .Get "cols" | default "2" }} + +{{ $ctx.Set "tag" $tag }} +{{ $ctx.Set "members" slice }} +{{ range $key, $value := site.Data.bouncmpe.people }} + {{ if intersect $value.tags (slice $tag) }} + {{ $ctx.Set "members" ($ctx.Get "members" | append $value) }} + {{ end }} +{{ end }} +{{ $members := $ctx.Get "members" }} + +
+ {{ range $members }} +
+ {{ $thumbnail := .thumbnail | default "images/person.png" }} + {{ $image_settings := site.Params.people.image_settings | default "500x500 webp q90 smart" }} + {{ $image_resource := resources.Get $thumbnail }} + + {{ if $image_resource }} + {{ $retouched := $image_resource.Fill $image_settings }} + {{ $thumbnail = $retouched.RelPermalink }} + {{ end }} + +
+
+
+ {{ .name | anchorize }}-thumbnail +
+
+
+
{{ .name | title }}
+ {{ with .position }} +

{{ . | i18n | title }}

+ {{ end }} + {{ with .research_areas }} +
+ {{ $lastIndex := sub (len .) 1 }} + {{ range $index, $area := . }} + {{ $area | title }}{{ if ne $index $lastIndex }}, {{ end }} + {{ end }} +
+ {{ end }} +

+ {{ with .email }} + + Email + + {{ end }} + {{ with .homepage }} + + Homepage + + {{ end }} + {{ with .github }} + + GitHub + + {{ end }} +

+
+
+
+
+
+ {{ end }} +