diff --git a/modules/wowchemy-core/layouts/partials/functions/get_sort_by_parameter.html b/modules/wowchemy-core/layouts/partials/functions/get_sort_by_parameter.html new file mode 100644 index 000000000..2d29519d9 --- /dev/null +++ b/modules/wowchemy-core/layouts/partials/functions/get_sort_by_parameter.html @@ -0,0 +1,24 @@ +{{/* Uniform 'sort_by' parameter between built-in Hugo and Wowchemy ones */}} +{{/* Input: 'sort_by' parameter (string) */}} +{{/* Output: fixed 'sort_by' parameter (string) */}} + +{{/* + Fix the 'sort_by' parameter, by adding "Params." as prefix if it is not a built-in Hugo parameter. + Since Wowchemy parameters are all standardised to lowercase-underscore convention, we: + - remove any leading ".": ".Date" is the same as "Date" + - check the first letter: + - if it is capitalized, then we have a built-in Hugo parameter, and we do nothing + - otherwise, it is a custom Wowchemy parameter, and we add "Params." as prefix + This logic should also be backward compatible, since "Params.my_param" is not modified. +*/}} + +{{ $param := strings.TrimLeft "." . }} +{{/* Get first letter */}} +{{ $first := substr $param 0 }} +{{/* Check if it is lowercase */}} +{{ if eq $first (lower $first) }} + {{/* Add 'Params.' prefix */}} + {{ $param = printf "Params.%s" $param }} +{{ end }} + +{{ return $param }} \ No newline at end of file diff --git a/modules/wowchemy/layouts/partials/blocks/collection.html b/modules/wowchemy/layouts/partials/blocks/collection.html index c0ae33a4c..2effdc6df 100644 --- a/modules/wowchemy/layouts/partials/blocks/collection.html +++ b/modules/wowchemy/layouts/partials/blocks/collection.html @@ -63,6 +63,7 @@ {{/* Sort */}} {{ $sort_by := $block.content.sort_by | default "Date" }} +{{ $sort_by = partial "functions/get_sort_by_parameter" $sort_by }} {{ $sort_ascending := $block.content.sort_ascending | default (eq $block.content.order "asc") | default false }} {{ $sort_order := cond $sort_ascending "asc" "desc" }} {{ $query = sort $query $sort_by $sort_order }} diff --git a/modules/wowchemy/layouts/partials/blocks/contact.html b/modules/wowchemy/layouts/partials/blocks/contact.html index 22de1cb20..db8eec28e 100644 --- a/modules/wowchemy/layouts/partials/blocks/contact.html +++ b/modules/wowchemy/layouts/partials/blocks/contact.html @@ -24,7 +24,7 @@ {{ end }}
- {{ with $block.content.text }}{{ . | emojify | $page.RenderString }}{{ end }} + {{ with $block.content.text }}

{{ . | emojify | $page.RenderString }}

{{ end }} {{ if $use_form }} diff --git a/modules/wowchemy/layouts/partials/blocks/people.html b/modules/wowchemy/layouts/partials/blocks/people.html new file mode 100644 index 000000000..b4de78b2d --- /dev/null +++ b/modules/wowchemy/layouts/partials/blocks/people.html @@ -0,0 +1,73 @@ +{{/* Wowchemy Blocks: People */}} +{{/* Documentation: https://wowchemy.com/blocks/ */}} +{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}} + +{{/* Initialise */}} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} +{{ $show_social := $block.design.show_social | default false }} +{{ $show_interests := $block.design.show_interests | default true }} +{{ $show_organizations := $block.design.show_organizations | default false }} +{{ $show_role := $block.design.show_role | default true }} + +
+ {{ with $block.content.title }} +
+

{{ . | markdownify | emojify }}

+ {{ with $block.content.subtitle }}

{{ . | markdownify | emojify }}

{{ end }} +
+ {{ end }} + + {{ with $block.content.text }} +
+ {{ . | emojify | $page.RenderString }} +
+ {{ end }} + + {{ range $block.content.user_groups }} + {{ $query := where (where site.Pages "Section" "authors") ".Params.user_groups" "intersect" (slice .) }} + + {{/* Sort */}} + {{ $sort_by := $block.content.sort_by | default "Params.last_name" }} + {{ $sort_by = partial "functions/get_sort_by_parameter" $sort_by }} + {{ $sort_ascending := $block.content.sort_ascending | default true }} + {{ $sort_order := cond $sort_ascending "asc" "desc" }} + {{ $query = sort $query $sort_by $sort_order }} + + {{if $query | and (gt (len $block.content.user_groups) 1) }} +
+

{{ . | markdownify }}

+
+ {{end}} + + {{ range $query }} + {{ $avatar := (.Resources.ByType "image").GetMatch "*avatar*" }} + {{/* Get link to user's profile page. */}} + {{ $link := "" }} + {{ with site.GetPage (printf "/authors/%s" (path.Base .File.Dir)) }} + {{ $link = .RelPermalink }} + {{ end }} +
+ {{ $src := "" }} + {{ if site.Params.features.avatar.gravatar }} + {{ $src = printf "https://s.gravatar.com/avatar/%s?s=150" (md5 .Params.email) }} + {{ else if $avatar }} + {{ $avatar_image := $avatar.Fill "270x270 Center" }} + {{ $src = $avatar_image.RelPermalink }} + {{ end }} + {{ if $src }} + {{ $avatar_shape := site.Params.features.avatar.shape | default "circle" }} + {{with $link}}{{end}}Avatar{{if $link}}{{end}} + {{ end }} + +
+

{{with $link}}{{end}}{{ .Title }}{{if $link}}{{end}}

+ {{ if and $show_organizations .Params.organizations }}{{ range .Params.organizations }}

{{ .name }}

{{ end }}{{ end }} + {{ if and $show_role .Params.role }}

{{ .Params.role | markdownify | emojify }}

{{ end }} + {{ if $show_social }}{{ partial "social_links" . }}{{ end }} + {{ if and $show_interests .Params.interests }}

{{ delimit .Params.interests ", " | markdownify | emojify }}

{{ end }} +
+
+ {{ end }} + {{ end }} +
diff --git a/modules/wowchemy/layouts/partials/blocks/portfolio.html b/modules/wowchemy/layouts/partials/blocks/portfolio.html index 702daa25e..c0d47096e 100644 --- a/modules/wowchemy/layouts/partials/blocks/portfolio.html +++ b/modules/wowchemy/layouts/partials/blocks/portfolio.html @@ -87,6 +87,7 @@ {{/* Sort */}} {{ $sort_by := $block.content.sort_by | default "Date" }} + {{ $sort_by = partial "functions/get_sort_by_parameter" $sort_by }} {{ $sort_ascending := $block.content.sort_ascending | default (eq $block.content.order "asc") | default false }} {{ $sort_order := cond $sort_ascending "asc" "desc" }} {{ $query = sort $query $sort_by $sort_order }} diff --git a/modules/wowchemy/layouts/partials/blocks/slider.html b/modules/wowchemy/layouts/partials/blocks/slider.html new file mode 100644 index 000000000..d792d21ae --- /dev/null +++ b/modules/wowchemy/layouts/partials/blocks/slider.html @@ -0,0 +1,91 @@ +{{/* Wowchemy Blocks: Slider */}} +{{/* Documentation: https://wowchemy.com/blocks/ */}} +{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}} + +{{/* Initialise */}} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} +{{ $hash_id := .wcIdentifier }} + + + + + + + + + + + Previous + + + + Next + diff --git a/starters/research-group/content/_index.md b/starters/research-group/content/_index.md new file mode 100644 index 000000000..780be72d3 --- /dev/null +++ b/starters/research-group/content/_index.md @@ -0,0 +1,67 @@ +--- +# Leave the homepage title empty to use the site title +title: +date: 2022-10-24 +type: landing + +sections: + - block: hero + content: + title: | + Wowchemy + Research Group + image: + filename: welcome.jpg + text: | +
+ + The **Wowchemy Research Group** has been a center of excellence for Artificial Intelligence research, teaching, and practice since its founding in 2016. + + - block: collection + content: + title: Latest News + subtitle: + text: + count: 5 + filters: + author: '' + category: '' + exclude_featured: false + publication_type: '' + tag: '' + offset: 0 + order: desc + page_type: post + design: + view: card + columns: '1' + + - block: markdown + content: + title: + subtitle: '' + text: + design: + columns: '1' + background: + image: + filename: coders.jpg + filters: + brightness: 1 + parallax: false + position: center + size: cover + text_color_light: true + spacing: + padding: ['20px', '0', '20px', '0'] + css_class: fullscreen + + - block: markdown + content: + title: + subtitle: + text: | + {{% cta cta_link="./people/" cta_text="Meet the team →" %}} + design: + columns: '1' +--- \ No newline at end of file diff --git a/starters/research-group/content/authors/admin/_index.md b/starters/research-group/content/authors/admin/_index.md index 7b2f30b57..7ffba2728 100644 --- a/starters/research-group/content/authors/admin/_index.md +++ b/starters/research-group/content/authors/admin/_index.md @@ -2,6 +2,10 @@ # Display name title: Nelson Bighetti +# Full Name (for SEO) +first_name: Nelson +last_name: Bighetti + # Is this the primary user of the site? superuser: true diff --git "a/starters/research-group/content/authors/\345\220\263\346\201\251\351\201\224/_index.md" "b/starters/research-group/content/authors/\345\220\263\346\201\251\351\201\224/_index.md" index 4ffd1bffc..a85a80892 100644 --- "a/starters/research-group/content/authors/\345\220\263\346\201\251\351\201\224/_index.md" +++ "b/starters/research-group/content/authors/\345\220\263\346\201\251\351\201\224/_index.md" @@ -1,6 +1,10 @@ --- # Display name -title: 吳恩達 +title: Alice Wu 吳恩達 + +# Full name (for SEO) +first_name: Alice +last_name: Wu # Username (this should match the folder name) authors: diff --git a/starters/research-group/content/contact/contact.md b/starters/research-group/content/contact/contact.md deleted file mode 100644 index fddda8029..000000000 --- a/starters/research-group/content/contact/contact.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -# An instance of the Contact widget. -# Documentation: https://wowchemy.com/docs/page-builder/ -widget: contact - -# This file represents a page section. -headless: true - -# Order that this section appears on the page. -weight: 10 - -title: Contact -subtitle: - -content: - # Contact (edit or remove options as required) - - email: test@example.org - phone: 888 888 88 88 - address: - street: 450 Serra Mall - city: Stanford - region: CA - postcode: '94305' - country: United States - country_code: US - coordinates: - latitude: '37.4275' - longitude: '-122.1697' - directions: Enter Building 1 and take the stairs to Office 200 on Floor 2 - office_hours: - - 'Monday 10:00 to 13:00' - - 'Wednesday 09:00 to 10:00' - appointment_url: 'https://calendly.com' - #contact_links: - # - icon: comments - # icon_pack: fas - # name: Discuss on Forum - # link: 'https://discourse.gohugo.io' - - # Automatically link email and phone or display as text? - autolink: true - - # Email form provider - form: - provider: netlify - formspree: - id: - netlify: - # Enable CAPTCHA challenge to reduce spam? - captcha: false - -design: - columns: '1' ---- - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus augue non tempor egestas. Proin nisl nunc, dignissim in accumsan dapibus, auctor ullamcorper neque. Quisque at elit felis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Aenean eget elementum odio. Cras interdum eget risus sit amet aliquet. In volutpat, nisl ut fringilla dignissim, arcu nisl suscipit ante, at accumsan sapien nisl eu eros. diff --git a/starters/research-group/content/contact/image.md b/starters/research-group/content/contact/image.md deleted file mode 100644 index 71324748b..000000000 --- a/starters/research-group/content/contact/image.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -# An instance of the Blank widget. -# Documentation: https://wowchemy.com/docs/page-builder/ -widget: blank - -# This file represents a page section. -headless: true - -# Order that this section appears on the page. -weight: 20 - -title: -subtitle: - -design: - columns: '1' - background: - image: contact.jpg - image_darken: 0 - image_parallax: false - image_position: center - image_size: cover - text_color_light: true - spacing: - padding: ['20px', '0', '20px', '0'] -advanced: - css_class: fullscreen ---- diff --git a/starters/research-group/content/contact/index.md b/starters/research-group/content/contact/index.md index 2a20a6eb5..d1e4f65f2 100644 --- a/starters/research-group/content/contact/index.md +++ b/starters/research-group/content/contact/index.md @@ -1,4 +1,69 @@ --- -# Files in this folder represent a Widget Page -type: widget_page +title: Contact +date: 2022-10-24 + +type: landing + +sections: + - block: contact + content: + title: Contact + text: |- + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus augue non tempor egestas. Proin nisl nunc, dignissim in accumsan dapibus, auctor ullamcorper neque. Quisque at elit felis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Aenean eget elementum odio. Cras interdum eget risus sit amet aliquet. In volutpat, nisl ut fringilla dignissim, arcu nisl suscipit ante, at accumsan sapien nisl eu eros. + email: test@example.org + phone: 888 888 88 88 + address: + street: 450 Serra Mall + city: Stanford + region: CA + postcode: '94305' + country: United States + country_code: US + coordinates: + latitude: '37.4275' + longitude: '-122.1697' + directions: Enter Building 1 and take the stairs to Office 200 on Floor 2 + office_hours: + - 'Monday 10:00 to 13:00' + - 'Wednesday 09:00 to 10:00' + appointment_url: 'https://calendly.com' + #contact_links: + # - icon: comments + # icon_pack: fas + # name: Discuss on Forum + # link: 'https://discourse.gohugo.io' + + # Automatically link email and phone or display as text? + autolink: true + + # Email form provider + form: + provider: netlify + formspree: + id: + netlify: + # Enable CAPTCHA challenge to reduce spam? + captcha: false + design: + columns: '1' + + - block: markdown + content: + title: + subtitle: '' + text: + design: + columns: '1' + background: + image: + filename: contact.jpg + filters: + brightness: 1 + parallax: false + position: center + size: cover + text_color_light: true + spacing: + padding: ['20px', '0', '20px', '0'] + css_class: fullscreen --- diff --git a/starters/research-group/content/home/cta.md b/starters/research-group/content/home/cta.md deleted file mode 100644 index cd7b768aa..000000000 --- a/starters/research-group/content/home/cta.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: -subtitle: -widget: blank -headless: true -weight: 40 -design: - columns: '1' ---- - -{{% cta cta_link="./people/" cta_text="Meet the team →" %}} diff --git a/starters/research-group/content/home/image.md b/starters/research-group/content/home/image.md deleted file mode 100644 index 07a94a75b..000000000 --- a/starters/research-group/content/home/image.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -# An instance of the Blank widget. -# Documentation: https://wowchemy.com/docs/page-builder/ -widget: blank - -# Activate this widget? true/false -active: true - -# This file represents a page section. -headless: true - -# Order that this section appears on the page. -weight: 30 - -title: -subtitle: - -design: - columns: '1' - background: - image: coders.jpg - image_darken: 0 - image_parallax: false - image_position: center - image_size: cover - text_color_light: true - spacing: - padding: ['20px', '0', '20px', '0'] -advanced: - css_class: fullscreen ---- diff --git a/starters/research-group/content/home/index.md b/starters/research-group/content/home/index.md deleted file mode 100644 index a00b5e585..000000000 --- a/starters/research-group/content/home/index.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -# Files in this folder represent a Widget Page (homepage) -type: widget_page - -# Homepage is headless, other widget pages are not. -headless: true ---- diff --git a/starters/research-group/content/home/news.md b/starters/research-group/content/home/news.md deleted file mode 100644 index 0799c962c..000000000 --- a/starters/research-group/content/home/news.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -# Documentation: https://wowchemy.com/docs/page-builder/ -widget: pages -headless: true -weight: 20 - -title: Latest News -subtitle: - -content: - count: 5 - filters: - author: '' - category: '' - exclude_featured: false - publication_type: '' - tag: '' - offset: 0 - order: desc - page_type: post -design: - view: 3 - columns: '1' ---- diff --git a/starters/research-group/content/home/welcome.md b/starters/research-group/content/home/welcome.md deleted file mode 100644 index 3c3c659a3..000000000 --- a/starters/research-group/content/home/welcome.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -# A Demo section created with the Blank widget. -# Any elements can be added in the body: https://wowchemy.com/docs/writing-markdown-latex/ -# Add more sections by duplicating this file and customizing to your requirements. - -widget: hero # See https://wowchemy.com/docs/page-builder/ -headless: true # This file represents a page section. -weight: 10 # Order that this section will appear. -title: | - Wowchemy - Research Group -hero_media: welcome.jpg -design: - # Choose how many columns the section has. Valid values: 1 or 2. - columns: '1' - # Add custom styles - css_style: - css_class: ---- - -
- -The **Wowchemy Research Group** has been a center of excellence for Artificial Intelligence research, teaching, and practice since its founding in 2016. diff --git a/starters/research-group/content/people/index.md b/starters/research-group/content/people/index.md index 2a20a6eb5..c10a00e28 100644 --- a/starters/research-group/content/people/index.md +++ b/starters/research-group/content/people/index.md @@ -1,4 +1,26 @@ --- -# Files in this folder represent a Widget Page -type: widget_page ---- +title: People +date: 2022-10-24 + +type: landing + +sections: + - block: people + content: + title: Meet the Team + # Choose which groups/teams of users to display. + # Edit `user_groups` in each user's profile to add them to one or more of these groups. + user_groups: + - Principal Investigators + - Researchers + - Grad Students + - Administration + - Visitors + - Alumni + sort_by: Params.last_name + sort_ascending: true + design: + show_interests: false + show_role: true + show_social: true +--- \ No newline at end of file diff --git a/starters/research-group/content/people/people.md b/starters/research-group/content/people/people.md deleted file mode 100644 index caae2d0db..000000000 --- a/starters/research-group/content/people/people.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -# An instance of the People widget. -# Documentation: https://wowchemy.com/docs/page-builder/ -widget: people - -# This file represents a page section. -headless: true - -# Order that this section appears on the page. -weight: 68 - -title: Meet the Team -subtitle: - -content: - # Choose which groups/teams of users to display. - # Edit `user_groups` in each user's profile to add them to one or more of these groups. - user_groups: - - Principal Investigators - - Researchers - - Grad Students - - Administration - - Visitors - - Alumni -design: - show_interests: false - show_role: true - show_social: true ---- diff --git a/starters/research-group/content/tour/index.md b/starters/research-group/content/tour/index.md index 301242b38..28554db99 100644 --- a/starters/research-group/content/tour/index.md +++ b/starters/research-group/content/tour/index.md @@ -1,6 +1,54 @@ --- title: Tour +date: 2022-10-24 -# Files in this folder represent a Widget Page -type: widget_page +type: landing + +sections: + - block: slider + content: + slides: + - title: 👋 Welcome to the group + content: Take a look at what we're working on... + align: center + background: + image: + filename: coders.jpg + filters: + brightness: 0.7 + position: right + color: '#666' + - title: Lunch & Learn ☕️ + content: 'Share your knowledge with the group and explore exciting new topics together!' + align: left + background: + image: + filename: contact.jpg + filters: + brightness: 0.7 + position: center + color: '#555' + - title: World-Class Semiconductor Lab + content: 'Just opened last month!' + align: right + background: + image: + filename: welcome.jpg + filters: + brightness: 0.5 + position: center + color: '#333' + link: + icon: graduation-cap + icon_pack: fas + text: Join Us + url: ../contact/ + design: + # Slide height is automatic unless you force a specific height (e.g. '400px') + slide_height: '' + is_fullscreen: true + # Automatically transition through slides? + loop: false + # Duration of transition between slides (in ms) + interval: 2000 --- diff --git a/starters/research-group/content/tour/slider.md b/starters/research-group/content/tour/slider.md deleted file mode 100644 index 04bb64182..000000000 --- a/starters/research-group/content/tour/slider.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -widget: slider -weight: 1 -active: true -headless: true - -design: - # Slide height is automatic unless you force a specific height (e.g. '400px') - slide_height: '' - is_fullscreen: true - # Automatically transition through slides? - loop: false - # Duration of transition between slides (in ms) - interval: 2000 - -content: - slides: - - title: 👋 Welcome to the group - content: Take a look at what we're working on... - align: center - background: - position: right - color: '#666' - brightness: 0.7 - media: coders.jpg - - title: Lunch & Learn ☕️ - content: 'Share your knowledge with the group and explore exciting new topics together!' - align: left - background: - position: center - color: '#555' - brightness: 0.7 - media: contact.jpg - - title: World-Class Semiconductor Lab - content: 'Just opened last month!' - align: right - background: - position: center - color: '#333' - brightness: 0.5 - media: welcome.jpg - link: - icon: graduation-cap - icon_pack: fas - text: Join Us - url: ../contact/ ---- diff --git a/starters/research-group/go.mod b/starters/research-group/go.mod index 8f271d881..675255327 100644 --- a/starters/research-group/go.mod +++ b/starters/research-group/go.mod @@ -5,5 +5,5 @@ go 1.15 require ( github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-netlify v1.0.0 // indirect github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-netlify-cms v1.0.0 // indirect - github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy/v5 v5.6.0 // indirect + github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy/v5 main // indirect )