diff --git a/modules/wowchemy/layouts/partials/widgets/about.avatar.html b/modules/wowchemy/layouts/partials/blocks/about.avatar.html similarity index 80% rename from modules/wowchemy/layouts/partials/widgets/about.avatar.html rename to modules/wowchemy/layouts/partials/blocks/about.avatar.html index 6389de98..59a22dd7 100644 --- a/modules/wowchemy/layouts/partials/widgets/about.avatar.html +++ b/modules/wowchemy/layouts/partials/blocks/about.avatar.html @@ -1,17 +1,22 @@ -{{ $ := .root }} -{{ $page := .page }} +{{/* Wowchemy Blocks: About - avatar variation */}} +{{/* Documentation: https://wowchemy.com/blocks/ */}} +{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}} + +{{/* Initialise */}} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} {{ $author := "" }} {{ if .author }} -{{ $author = .author }} + {{ $author = .author }} {{ else }} -{{ $author = $page.Params.author }} + {{ $author = $block.Params.author }} {{end}} {{ $person_page_path := (printf "/authors/%s" $author) }} {{ $person_page := site.GetPage $person_page_path }} {{ if not $person_page }} -{{ errorf "Could not find an author page at `%s`. Please check the value of `author` in your About widget and create an associated author page if one does not already exist. See https://wowchemy.com/docs/page-builder/#about " $person_page_path }} + {{ errorf "Could not find an author page at `%s`. Please check the value of `author` in your About widget and create an associated author page if one does not already exist. See https://wowchemy.com/docs/page-builder/#about " $person_page_path }} {{end}} {{ $person := $person_page.Params }} {{ $avatar := ($person_page.Resources.ByType "image").GetMatch "*avatar*" }} @@ -77,7 +82,7 @@ {{ end }} - {{ with $page.Content }} + {{ with $block.Content }}
{{ . }}
diff --git a/modules/wowchemy/layouts/partials/widgets/about.html b/modules/wowchemy/layouts/partials/blocks/about.html similarity index 91% rename from modules/wowchemy/layouts/partials/widgets/about.html rename to modules/wowchemy/layouts/partials/blocks/about.html index 74f08a14..c3735690 100644 --- a/modules/wowchemy/layouts/partials/widgets/about.html +++ b/modules/wowchemy/layouts/partials/blocks/about.html @@ -1,11 +1,16 @@ -{{ $ := .root }} -{{ $page := .page }} +{{/* Wowchemy Blocks: About */}} +{{/* Documentation: https://wowchemy.com/blocks/ */}} +{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}} + +{{/* Initialise */}} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} {{ $author := "" }} {{ if .author }} {{ $author = .author }} {{ else }} - {{ $author = $page.Params.author }} + {{ $author = $block.Params.author }} {{end}} {{ $person_page_path := (printf "/authors/%s" $author) }} @@ -83,7 +88,7 @@
{{/* Only display widget title in explicit instances of about widget, not in author pages. */}} - {{ if and $page.Params.widget $page.Title }}

{{ $page.Title | markdownify | emojify }}

{{ end }} + {{ if and $block.Params.widget $block.Title }}

{{ $block.Title | markdownify | emojify }}

{{ end }}
{{ $person_page.Content }} diff --git a/modules/wowchemy/layouts/partials/widgets/accomplishments.html b/modules/wowchemy/layouts/partials/blocks/accomplishments.html similarity index 73% rename from modules/wowchemy/layouts/partials/widgets/accomplishments.html rename to modules/wowchemy/layouts/partials/blocks/accomplishments.html index e92fcff8..0edc6d4d 100644 --- a/modules/wowchemy/layouts/partials/widgets/accomplishments.html +++ b/modules/wowchemy/layouts/partials/blocks/accomplishments.html @@ -1,13 +1,18 @@ -{{ $ := .root }} -{{ $page := .page }} -{{ $columns := $page.Params.design.columns | default "2" }} +{{/* Wowchemy Blocks: Accomplishments */}} +{{/* Documentation: https://wowchemy.com/blocks/ */}} +{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}} + +{{/* Initialise */}} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} +{{ $columns := $block.Params.design.columns | default "2" }}
- {{ with $page.Content }}{{ . }}{{ end }} + {{ with $block.Content }}{{ . }}{{ end }} - {{ if $page.Params.item }} - {{ range $idx, $key := sort $page.Params.item ".date_start" "desc" }} + {{ if $block.Params.item }} + {{ range $idx, $key := sort $block.Params.item ".date_start" "desc" }}
{{- $svg_icon := resources.Get (printf "media/icons/brands/%s.svg" (replace (lower .organization) " " "_")) -}} @@ -32,9 +37,9 @@ - {{ (time .date_start) | time.Format ($page.Params.date_format | default "Jan 2006") }} + {{ (time .date_start) | time.Format ($block.Params.date_format | default "Jan 2006") }} {{ if .date_end}} - – {{ (time .date_end) | time.Format ($page.Params.date_format | default "Jan 2006") }} + – {{ (time .date_end) | time.Format ($block.Params.date_format | default "Jan 2006") }} {{end}}
diff --git a/modules/wowchemy/layouts/partials/widgets/pages.html b/modules/wowchemy/layouts/partials/blocks/collection.html similarity index 52% rename from modules/wowchemy/layouts/partials/widgets/pages.html rename to modules/wowchemy/layouts/partials/blocks/collection.html index 9423a030..369b58b7 100644 --- a/modules/wowchemy/layouts/partials/widgets/pages.html +++ b/modules/wowchemy/layouts/partials/blocks/collection.html @@ -1,12 +1,13 @@ -{{/* Pages Widget */}} -{{/* https://wowchemy.com/docs/widget/ */}} +{{/* Wowchemy Blocks: Collection */}} +{{/* Documentation: https://wowchemy.com/blocks/ */}} +{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}} {{/* Initialise */}} -{{ $ := .root }} -{{ $st := .page }} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} -{{ $items_offset := $st.Params.content.offset | default 0 }} -{{ $items_count := $st.Params.content.count }} +{{ $items_offset := $block.Params.content.offset | default 0 }} +{{ $items_count := $block.Params.content.count }} {{ if eq $items_count 0 }} {{ $items_count = 65535 }} {{ else }} @@ -18,48 +19,51 @@ {{ $archive_page := "" }} {{/* Filters */}} -{{ if $st.Params.content.page_type }} - {{ $query = where $query "Type" $st.Params.content.page_type }} - {{ $archive_page = site.GetPage "Section" $st.Params.content.page_type }} +{{ if $block.Params.content.page_type }} + {{ $query = where $query "Type" $block.Params.content.page_type }} + {{ $archive_page = site.GetPage "Section" $block.Params.content.page_type }} {{ end }} -{{ if $st.Params.content.filters.folders }} - {{ $folders := $st.Params.content.filters.folders }} +{{ if $block.Params.content.filters.folders }} + {{ $folders := $block.Params.content.filters.folders }} {{ $query = where $query "Section" "in" $folders }} {{/* Init archive page to main folder */}} {{ $main_folder := index $folders 0 }} {{ $archive_page = site.GetPage "Section" $main_folder }} {{ end }} -{{ if $st.Params.content.filters.tag }} - {{ $archive_page = site.GetPage (printf "tags/%s" (urlize $st.Params.content.filters.tag)) }} +{{ if $block.Params.content.filters.tag }} + {{ $archive_page = site.GetPage (printf "tags/%s" (urlize $block.Params.content.filters.tag)) }} {{ $query = $query | intersect $archive_page.Pages }} {{ end }} -{{ if $st.Params.content.filters.category }} - {{ $archive_page = site.GetPage (printf "categories/%s" (urlize $st.Params.content.filters.category)) }} +{{ if $block.Params.content.filters.category }} + {{ $archive_page = site.GetPage (printf "categories/%s" (urlize $block.Params.content.filters.category)) }} {{ $query = $query | intersect $archive_page.Pages }} {{ end }} -{{ if $st.Params.content.filters.publication_type }} - {{ $archive_page = site.GetPage (printf "publication_types/%s" $st.Params.content.filters.publication_type) }} +{{ if $block.Params.content.filters.publication_type }} + {{ $archive_page = site.GetPage (printf "publication_types/%s" $block.Params.content.filters.publication_type) }} {{ $query = $query | intersect $archive_page.Pages }} {{ end }} -{{ if $st.Params.content.filters.author }} - {{ $archive_page = site.GetPage (printf "authors/%s" (urlize $st.Params.content.filters.author)) }} +{{ if $block.Params.content.filters.author }} + {{ $archive_page = site.GetPage (printf "authors/%s" (urlize $block.Params.content.filters.author)) }} {{ $query = $query | intersect $archive_page.Pages }} {{ end }} -{{ if $st.Params.content.filters.exclude_featured }} +{{ if $block.Params.content.filters.featured_only }} + {{ $query = where $query "Params.featured" "==" true }} +{{ end }} +{{ if $block.Params.content.filters.exclude_featured }} {{ $query = where $query "Params.featured" "!=" true }} {{ end }} -{{ if $st.Params.content.filters.exclude_past }} +{{ if $block.Params.content.filters.exclude_past }} {{ $query = where $query "Date" ">=" now }} {{ end }} -{{ if $st.Params.content.filters.exclude_future }} +{{ if $block.Params.content.filters.exclude_future }} {{ $query = where $query "Date" "<" now }} {{ end }} {{ $count := len $query }} {{/* Sort */}} -{{ $sort_by := $st.Params.content.sort_by | default "Date" }} -{{ $sort_ascending := $st.Params.content.sort_ascending | default (eq $st.Params.content.order "asc") | default false }} +{{ $sort_by := $block.Params.content.sort_by | default "Date" }} +{{ $sort_ascending := $block.Params.content.sort_ascending | default (eq $block.Params.content.order "asc") | default false }} {{ $sort_order := cond $sort_ascending "asc" "desc" }} {{ $query = sort $query $sort_by $sort_order }} @@ -70,23 +74,23 @@ {{ $query = first $items_count $query }} {{ end }} -{{ $columns := $st.Params.design.columns | default "2" }} +{{ $columns := $block.Params.design.columns | default "2" }}
- {{ with $st.Content }}{{ . }}{{ end }} + {{ with $block.Content }}{{ . }}{{ end }} {{ range $index, $item := $query }} - {{ partial "functions/render_view" (dict "page" $st "item" . "view" ($st.Params.design.view | default "compact") "index" $index) }} + {{ partial "functions/render_view" (dict "page" $block "item" . "view" ($block.Params.design.view | default "compact") "index" $index) }} {{end}} {{/* Archive link */}} - {{ $show_archive_link := $st.Params.content.archive.enable | default (gt $count $items_count) }} + {{ $show_archive_link := $block.Params.content.archive.enable | default (gt $count $items_count) }} {{ if $show_archive_link | and $archive_page }} {{ $archive_link := "" }} - {{ if $st.Params.content.archive.link }} - {{ $archive_link = $st.Params.content.archive.link | relLangURL }} + {{ if $block.Params.content.archive.link }} + {{ $archive_link = $block.Params.content.archive.link | relLangURL }} {{ else }} {{ $archive_link = $archive_page.RelPermalink }} {{ end }} @@ -104,7 +108,7 @@ {{ $i18n = "more_pages" }} {{ end }} - {{ $archive_text := $st.Params.content.archive.text | default (i18n $i18n) | default "See all" }} + {{ $archive_text := $block.Params.content.archive.text | default (i18n $i18n) | default "See all" }}
diff --git a/modules/wowchemy/layouts/partials/widgets/contact.html b/modules/wowchemy/layouts/partials/blocks/contact.html similarity index 83% rename from modules/wowchemy/layouts/partials/widgets/contact.html rename to modules/wowchemy/layouts/partials/blocks/contact.html index 03efca59..8e19a665 100644 --- a/modules/wowchemy/layouts/partials/widgets/contact.html +++ b/modules/wowchemy/layouts/partials/blocks/contact.html @@ -1,26 +1,31 @@ -{{ $ := .root }} -{{ $st := .page }} -{{ $autolink := default true $st.Params.content.autolink }} -{{ $data := $st.Params.content }} +{{/* Wowchemy Blocks: Contact */}} +{{/* Documentation: https://wowchemy.com/blocks/ */}} +{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}} -{{ $form_provider := lower $st.Params.content.form.provider | default "" }} -{{ $form_provider_legacy := $st.Params.email_form | default 0 }} +{{/* Initialise */}} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} +{{ $autolink := default true $block.Params.content.autolink }} +{{ $data := $block.Params.content }} + +{{ $form_provider := lower $block.Params.content.form.provider | default "" }} +{{ $form_provider_legacy := $block.Params.email_form | default 0 }} {{ $use_netlify_form := eq $form_provider "netlify" | or (eq $form_provider_legacy 1) }} {{ $use_formspree_form := eq $form_provider "formspree" | or (eq $form_provider_legacy 2) }} {{ $use_form := or $use_netlify_form $use_formspree_form }} -{{ $use_netlify_captcha := $st.Params.content.form.netlify.captcha | default true }} -{{ $use_formspree_captcha := $st.Params.content.form.formspree.captcha | default false }} +{{ $use_netlify_captcha := $block.Params.content.form.netlify.captcha | default true }} +{{ $use_formspree_captcha := $block.Params.content.form.formspree.captcha | default false }} -{{ $columns := $st.Params.design.columns | default "2" }} +{{ $columns := $block.Params.design.columns | default "2" }} {{ if and $use_formspree_form $use_formspree_captcha }} {{ end }}
- {{ with $st.Content }}{{ . }}{{ end }} + {{ with $block.Content }}{{ . }}{{ end }} {{ if $use_form }} @@ -28,17 +33,17 @@ {{ if $use_netlify_form }} {{ $post_action = "netlify" }} {{ else if $use_formspree_form }} - {{ if not $st.Params.content.form.formspree.id }} + {{ if not $block.Params.content.form.formspree.id }} {{ errorf "You have chosen to use Formspree as the provider for the contact form. Please set your Formspree Form ID in the Contact widget or disable the form.\nDocumentation: https://wowchemy.com/docs/widget/contact/" }} {{ end }} - {{ if and $use_formspree_captcha (not $st.Params.content.form.formspree.captcha_key) }} + {{ if and $use_formspree_captcha (not $block.Params.content.form.formspree.captcha_key) }} {{ errorf "You have chosen to use reCAPTCHA for Formspree. Please set your Formspree CAPTCHA KEY in the Contact widget or disable reCAPTCHA.\nDocumentation: https://help.formspree.io/hc/en-us/articles/360022811154" }} {{ end }} - {{ $post_action = printf "action=\"https://formspree.io/f/%s\"" $st.Params.content.form.formspree.id }} + {{ $post_action = printf "action=\"https://formspree.io/f/%s\"" $block.Params.content.form.formspree.id }} {{ end }}
-
+
@@ -51,7 +56,7 @@
- {{ if $st.Params.content.form.netlify.attachments }} + {{ if $block.Params.content.form.netlify.attachments }}
@@ -63,7 +68,7 @@ {{ if and $use_netlify_form $use_netlify_captcha }}
{{ else if and $use_formspree_form $use_formspree_captcha }} -
+

{{ end }} diff --git a/modules/wowchemy/layouts/partials/widgets/experience.html b/modules/wowchemy/layouts/partials/blocks/experience.html similarity index 78% rename from modules/wowchemy/layouts/partials/widgets/experience.html rename to modules/wowchemy/layouts/partials/blocks/experience.html index 6c1ffb93..cbeca1cf 100644 --- a/modules/wowchemy/layouts/partials/widgets/experience.html +++ b/modules/wowchemy/layouts/partials/blocks/experience.html @@ -1,16 +1,21 @@ -{{ $ := .root }} -{{ $page := .page }} -{{ $columns := $page.Params.design.columns | default "2" }} +{{/* Wowchemy Blocks: Experience */}} +{{/* Documentation: https://wowchemy.com/blocks/ */}} +{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}} + +{{/* Initialise */}} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} +{{ $columns := $block.Params.design.columns | default "2" }}
- {{ with $page.Content }}{{ . }}{{ end }} + {{ with $block.Content }}{{ . }}{{ end }} - {{ if $page.Params.experience }} - {{ $exp_len := len $page.Params.experience }} + {{ if $block.Params.experience }} + {{ $exp_len := len $block.Params.experience }} {{/* Default to user's custom order (as requested in #1761) as Hugo doesn't support multiple sorts on params. */}} - {{ range $idx, $key := $page.Params.experience }} + {{ range $idx, $key := $block.Params.experience }}
- {{ (time .date_start) | time.Format ($page.Params.date_format | default "January 2006") }} – + {{ (time .date_start) | time.Format ($block.Params.date_format | default "January 2006") }} – {{ if .date_end}} - {{ (time .date_end) | time.Format ($page.Params.date_format | default "January 2006") }} + {{ (time .date_end) | time.Format ($block.Params.date_format | default "January 2006") }} {{else}} {{ i18n "present" | default "Present" }} {{end}} diff --git a/modules/wowchemy/layouts/partials/widgets/featurette.html b/modules/wowchemy/layouts/partials/blocks/features.html similarity index 70% rename from modules/wowchemy/layouts/partials/widgets/featurette.html rename to modules/wowchemy/layouts/partials/blocks/features.html index 3876d5b2..89af1b76 100644 --- a/modules/wowchemy/layouts/partials/widgets/featurette.html +++ b/modules/wowchemy/layouts/partials/blocks/features.html @@ -1,21 +1,26 @@ -{{ $ := .root }} -{{ $page := .page }} +{{/* Wowchemy Blocks: Features */}} +{{/* Documentation: https://wowchemy.com/blocks/ */}} +{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}} + +{{/* Initialise */}} +{{ $page := .wcPage }} +{{ $block := .wcBlock }}
- {{ with $page.Title }} + {{ with $block.Title }}

{{ . | markdownify | emojify }}

- {{ if $page.Params.subtitle }}

{{ $page.Params.subtitle | markdownify | emojify }}

{{ end }} + {{ if $block.Params.subtitle }}

{{ $block.Params.subtitle | markdownify | emojify }}

{{ end }}
{{ end }} - {{ with $page.Content }} + {{ with $block.Content }}
{{ . }}
{{ end }} - {{ range $page.Params.feature }} + {{ range $block.Params.feature }} {{ $pack := or .icon_pack "fas" }} {{ $pack_prefix := $pack }} {{ if in (slice "fab" "fas" "far" "fal") $pack }} diff --git a/modules/wowchemy/layouts/partials/widgets/hero.html b/modules/wowchemy/layouts/partials/blocks/hero.html similarity index 61% rename from modules/wowchemy/layouts/partials/widgets/hero.html rename to modules/wowchemy/layouts/partials/blocks/hero.html index d40d777b..8fa2b0c4 100644 --- a/modules/wowchemy/layouts/partials/widgets/hero.html +++ b/modules/wowchemy/layouts/partials/blocks/hero.html @@ -1,28 +1,33 @@ -{{ $ := .root }} -{{ $page := .page }} -{{ $bg := $page.Params.design.background }} +{{/* Wowchemy Blocks: Hero */}} +{{/* Documentation: https://wowchemy.com/blocks/ */}} +{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}} -{{ if $page.Params.hero_media }} +{{/* Initialise */}} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} +{{ $bg := $block.Params.design.background }} + +{{ if $block.Params.hero_media }}
{{ end }} - {{ with $page.Title }} + {{ with $block.Title }}

{{ . | markdownify }}

{{ end }} - {{ with $page.Content }} + {{ with $block.Content }}
{{ . }}
{{ end }} {{/* Call-to-action link */}} - {{ if $page.Params.cta.url }} - {{ $pack := or $page.Params.cta.icon_pack "fas" }} + {{ if $block.Params.cta.url }} + {{ $pack := or $block.Params.cta.icon_pack "fas" }} {{ $pack_prefix := $pack }} {{ if in (slice "fab" "fas" "far" "fal") $pack }} {{ $pack_prefix = "fa" }} {{ end }} - {{ $link := $page.Params.cta.url }} + {{ $link := $block.Params.cta.url }} {{ $scheme := (urls.Parse $link).Scheme }} {{ $target := "" }} {{ if not $scheme }} @@ -31,11 +36,11 @@ {{ $target = "target=\"_blank\" rel=\"noopener\"" }} {{ end }}

- {{ if $page.Params.cta.icon }}{{end}}{{ $page.Params.cta.label | markdownify | emojify | safeHTML }} + {{ if $block.Params.cta.icon }}{{end}}{{ $block.Params.cta.label | markdownify | emojify | safeHTML }} {{/* Alternative Call-to-action link */}} - {{ if $page.Params.cta_alt.url }} - {{ $link := $page.Params.cta_alt.url }} + {{ if $block.Params.cta_alt.url }} + {{ $link := $block.Params.cta_alt.url }} {{ $scheme := (urls.Parse $link).Scheme }} {{ $target := "" }} {{ if not $scheme }} @@ -43,31 +48,31 @@ {{ else if in (slice "http" "https") $scheme }} {{ $target = "target=\"_blank\" rel=\"noopener\"" }} {{ end }} - {{ $page.Params.cta_alt.label | markdownify | emojify | safeHTML }} + {{ $block.Params.cta_alt.label | markdownify | emojify | safeHTML }} {{ end }}

{{ end }} {{/* Call-to-action note */}} - {{ with $page.Params.cta_note }} + {{ with $block.Params.cta_note }}

{{ .label | markdownify | emojify | safeHTML }}

{{ end }} {{/* Hero image */}} - {{ if $page.Params.hero_media }} + {{ if $block.Params.hero_media }}
-
- {{- $image := ($page.Parent.Resources.ByType "image").GetMatch $page.Params.hero_media -}} +
+ {{- $image := ($block.Parent.Resources.ByType "image").GetMatch $block.Params.hero_media -}} {{- if not $image -}} - {{- $image = resources.Get (path.Join "media" $page.Params.hero_media) -}} + {{- $image = resources.Get (path.Join "media" $block.Params.hero_media) -}} {{- end -}} {{ if $image }} {{ $isSVG := eq $image.MediaType.SubType "svg" }} {{ if $isSVG -}} - {{ $page.Title }} + {{ $block.Title }} {{- else }} @@ -85,7 +90,7 @@ {{ end }} {{ $img_src_set = delimit $img_src_set "," }} - {{ $page.Title }} + {{ $block.Title }} {{ end }} {{ end }}
diff --git a/modules/wowchemy/layouts/partials/blocks/markdown.html b/modules/wowchemy/layouts/partials/blocks/markdown.html new file mode 100644 index 00000000..0e92ab48 --- /dev/null +++ b/modules/wowchemy/layouts/partials/blocks/markdown.html @@ -0,0 +1,18 @@ +{{/* Wowchemy Blocks: Markdown */}} +{{/* Documentation: https://wowchemy.com/blocks/ */}} +{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}} + +{{/* Initialise */}} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} +{{ $columns := $block.Params.design.columns | default "2" }} + +{{ if ne $columns "1" }} +
+ {{ $block.Content }} +
+{{ else }} +
+ {{ $block.Content }} +
+{{ end }} diff --git a/modules/wowchemy/layouts/partials/widgets/people.html b/modules/wowchemy/layouts/partials/blocks/people.html similarity index 71% rename from modules/wowchemy/layouts/partials/widgets/people.html rename to modules/wowchemy/layouts/partials/blocks/people.html index 2dd9c432..506a1f4f 100644 --- a/modules/wowchemy/layouts/partials/widgets/people.html +++ b/modules/wowchemy/layouts/partials/blocks/people.html @@ -1,31 +1,33 @@ -{{/* People Widget */}} +{{/* Wowchemy Blocks: People */}} +{{/* Documentation: https://wowchemy.com/blocks/ */}} +{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}} {{/* Initialise */}} -{{ $ := .root }} -{{ $page := .page }} -{{ $show_social := $page.Params.design.show_social | default false }} -{{ $show_interests := $page.Params.design.show_interests | default true }} -{{ $show_organizations := $page.Params.design.show_organizations | default false }} -{{ $show_role := $page.Params.design.show_role | default true }} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} +{{ $show_social := $block.Params.design.show_social | default false }} +{{ $show_interests := $block.Params.design.show_interests | default true }} +{{ $show_organizations := $block.Params.design.show_organizations | default false }} +{{ $show_role := $block.Params.design.show_role | default true }}
- {{ with $page.Title }} + {{ with $block.Title }}

{{ . | markdownify | emojify }}

- {{ if $page.Params.subtitle }}

{{ $page.Params.subtitle | markdownify | emojify }}

{{ end }} + {{ if $block.Params.subtitle }}

{{ $block.Params.subtitle | markdownify | emojify }}

{{ end }}
{{ end }} - {{ with $page.Content }} + {{ with $block.Content }}
{{ . }}
{{ end }} - {{ range $page.Params.content.user_groups }} + {{ range $block.Params.content.user_groups }} {{ $query := where (where site.Pages "Section" "authors") ".Params.user_groups" "intersect" (slice .) }} - {{if $query | and (gt (len $page.Params.content.user_groups) 1) }} + {{if $query | and (gt (len $block.Params.content.user_groups) 1) }}

{{ . | markdownify }}

diff --git a/modules/wowchemy/layouts/partials/widgets/portfolio.html b/modules/wowchemy/layouts/partials/blocks/portfolio.html similarity index 64% rename from modules/wowchemy/layouts/partials/widgets/portfolio.html rename to modules/wowchemy/layouts/partials/blocks/portfolio.html index 66d56e88..7740c470 100644 --- a/modules/wowchemy/layouts/partials/widgets/portfolio.html +++ b/modules/wowchemy/layouts/partials/blocks/portfolio.html @@ -1,24 +1,26 @@ -{{/* Portfolio Widget */}} +{{/* Wowchemy Blocks: Portfolio */}} +{{/* Documentation: https://wowchemy.com/blocks/ */}} +{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}} {{/* Initialise */}} -{{ $ := .root }} -{{ $st := .page }} -{{ $columns := $st.Params.design.columns | default "2" }} -{{ $view := $st.Params.design.view | default "masonry" }} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} +{{ $columns := $block.Params.design.columns | default "2" }} +{{ $view := $block.Params.design.view | default "masonry" }} {{/* Require Isotope */}} -{{ $.Page.Store.Set "has_isotope" true }} +{{ $page.Page.Store.Set "has_isotope" true }}
- {{ with $st.Content }}{{ . }}{{ end }} + {{ with $block.Content }}{{ . }}{{ end }} - {{ if $st.Params.content.filter_button }} + {{ if $block.Params.content.filter_button }} - {{ $filter_default := default (int $st.Params.content.filter_default) 0 }} + {{ $filter_default := default (int $block.Params.content.filter_default) 0 }} {{/* Parse default filter tag from front matter in the form of either tag name or CSS class name. */}} - {{ $default_filter_item := (index $st.Params.content.filter_button ($filter_default)) }} + {{ $default_filter_item := (index $block.Params.content.filter_button ($filter_default)) }} {{ $default_data_filter := "" }} {{ with $default_filter_item.filter }} {{ $default_data_filter = . }} @@ -34,12 +36,12 @@ {{ $default_data_filter }} {{/* Only show filter buttons if there are multiple filters. */}} - {{ if gt (len $st.Params.content.filter_button) 1 }} + {{ if gt (len $block.Params.content.filter_button) 1 }}
- {{ range $idx, $item := $st.Params.content.filter_button }} + {{ range $idx, $item := $block.Params.content.filter_button }} {{/* Parse filter tag from front matter in the form of either tag name or CSS class name. */}} {{ $data_filter := "" }} {{ with .filter }} @@ -60,32 +62,32 @@ {{ end }} {{ end }} -
+
{{/* Query */}} {{ $query := site.Pages }} {{/* Filters */}} - {{ with $st.Params.content.page_type }} + {{ with $block.Params.content.page_type }} {{/* Legacy filter, superseded by `filters.folders` */}} {{ $query = where $query "Type" . }} {{ end }} - {{ with $st.Params.content.filters.folders }} + {{ with $block.Params.content.filters.folders }} {{ $query = where $query "Section" "in" . }} {{ end }} - {{ with $st.Params.content.filters.tags }} + {{ with $block.Params.content.filters.tags }} {{ $query = where $query "Params.tags" "intersect" . }} {{ end }} - {{ with $st.Params.content.filters.exclude_tags }} + {{ with $block.Params.content.filters.exclude_tags }} {{ $query = $query | symdiff (where site.Pages "Params.tags" "intersect" .) }} {{ end }} - {{ with ($st.Params.content.filters.kinds | default (slice "page")) }} + {{ with ($block.Params.content.filters.kinds | default (slice "page")) }} {{ $query = where $query "Kind" "in" . }} {{ end }} {{/* Sort */}} - {{ $sort_by := $st.Params.content.sort_by | default "Date" }} - {{ $sort_ascending := $st.Params.content.sort_ascending | default (eq $st.Params.content.order "asc") | default false }} + {{ $sort_by := $block.Params.content.sort_by | default "Date" }} + {{ $sort_ascending := $block.Params.content.sort_ascending | default (eq $block.Params.content.order "asc") | default false }} {{ $sort_order := cond $sort_ascending "asc" "desc" }} {{ $query = sort $query $sort_by $sort_order }} @@ -96,7 +98,7 @@ {{else}}
{{end}} - {{ partial "functions/render_view" (dict "page" $st "item" . "view" $view "index" $index) }} + {{ partial "functions/render_view" (dict "page" $block "item" . "view" $view "index" $index) }}
{{end}} diff --git a/modules/wowchemy/layouts/partials/widgets/slider.html b/modules/wowchemy/layouts/partials/blocks/slider.html similarity index 85% rename from modules/wowchemy/layouts/partials/widgets/slider.html rename to modules/wowchemy/layouts/partials/blocks/slider.html index 9b51d61c..2dbd795e 100644 --- a/modules/wowchemy/layouts/partials/widgets/slider.html +++ b/modules/wowchemy/layouts/partials/blocks/slider.html @@ -1,22 +1,27 @@ -{{ $ := .root }} -{{ $page := .page }} -{{ $hash_id := .hash_id }} +{{/* 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 }}