diff --git a/modules/wowchemy/layouts/partials/blocks/accomplishments.html b/modules/wowchemy/layouts/partials/blocks/accomplishments.html new file mode 100644 index 00000000..887b8272 --- /dev/null +++ b/modules/wowchemy/layouts/partials/blocks/accomplishments.html @@ -0,0 +1,64 @@ +{{/* 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.design.columns | default "1" }} + + +
+ {{ with $block.Content }}{{ . }}{{ end }} + + {{ if $block.content.items }} + {{ range $idx, $key := sort $block.content.items ".date_start" "desc" }} +
+
+ {{- $svg_icon := resources.Get (printf "media/icons/brands/%s.svg" (replace (lower .organization) " " "_")) -}} + {{- if $svg_icon }} +
+
+ {{- with .organization_url}}{{end -}} + {{.organization | plainify}} + {{- with .organization_url}}{{end -}} +
+
+ {{ end }} + + {{- with .url -}}{{- end -}} +
{{.title | markdownify | emojify}}
+ {{- with .url -}}
{{- end -}} + + + + {{- if $svg_icon}} +
+
+ {{end}} + + {{with .description}} +
{{. | markdownify | emojify}}
+ {{end}} + + {{ with .certificate_url }} + + {{ i18n "see_certificate" | default "See certificate" }} + + {{ end }} +
+
+ {{end}} + {{end}} +
diff --git a/modules/wowchemy/layouts/partials/blocks/features.html b/modules/wowchemy/layouts/partials/blocks/features.html new file mode 100644 index 00000000..867b8a43 --- /dev/null +++ b/modules/wowchemy/layouts/partials/blocks/features.html @@ -0,0 +1,46 @@ +{{/* 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 $block.content.title }} +
+

{{ . | markdownify | emojify }}

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

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

{{ end }} +
+ {{ end }} + + {{ with $block.content.text }} +
+ {{ . | emojify | markdownify }} +
+ {{ end }} + + {{ range $block.content.items }} + {{ $pack := or .icon_pack "fas" }} + {{ $pack_prefix := $pack }} + {{ if in (slice "fab" "fas" "far" "fal") $pack }} + {{ $pack_prefix = "fa" }} + {{ end }} +
+ {{ with .icon }} +
+ {{- if eq $pack "emoji" -}} + {{- . | emojify -}} + {{- else if eq $pack "custom" -}} + {{- $svg_icon := resources.Get (printf "media/icons/%s.svg" .) -}} + {{- if $svg_icon -}}{{.}}{{- end -}} + {{- else -}} + + {{- end -}} +
+ {{ end }} +
{{ .name | markdownify | emojify }}
+ {{ with .description }}

{{ . | markdownify | emojify }}

{{ end }} +
+ {{ end }} +
diff --git a/modules/wowchemy/layouts/partials/blocks/hero.html b/modules/wowchemy/layouts/partials/blocks/hero.html new file mode 100644 index 00000000..7f0286c6 --- /dev/null +++ b/modules/wowchemy/layouts/partials/blocks/hero.html @@ -0,0 +1,92 @@ +{{/* Wowchemy Blocks: Hero */}} +{{/* Documentation: https://wowchemy.com/blocks/ */}} +{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}} + +{{/* Initialise */}} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} +{{ $bg := $block.design.background }} + +{{ if $block.content.image.filename }} +
+
+{{ end }} + + {{ with $block.content.title }} +

{{ . | markdownify }}

+ {{ end }} + + {{ with $block.content.text }} +
{{ . | markdownify | emojify }}
+ {{ end }} + + {{/* Call-to-action link */}} + {{ if $block.content.cta.url }} + {{ $pack := or $block.content.cta.icon_pack "fas" }} + {{ $pack_prefix := $pack }} + {{ if in (slice "fab" "fas" "far" "fal") $pack }} + {{ $pack_prefix = "fa" }} + {{ end }} + {{ $link := $block.content.cta.url }} + {{ $scheme := (urls.Parse $link).Scheme }} + {{ $target := "" }} + {{ if not $scheme }} + {{ $link = $link | relLangURL }} + {{ else if in (slice "http" "https") $scheme }} + {{ $target = "target=\"_blank\" rel=\"noopener\"" }} + {{ end }} +

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

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

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

+ {{ end }} + + {{/* Hero image */}} + {{ if $block.content.image.filename }} +
+
+ {{- $image := resources.Get (path.Join "media" $block.content.image.filename) -}} + {{ if $image }} + {{ $isSVG := eq $image.MediaType.SubType "svg" }} + {{ if $isSVG -}} + {{ $block.Title }} + {{- else }} + {{ $legacy_img := $image.Resize "400x" }} + {{ $img_src := "" }} + {{ $img_src_set := slice }} + {{ $widths := slice 1200 800 400 }} + + {{ range $widths }} + {{ $src_link := ($image.Resize (printf "%dx" .)).RelPermalink }} + {{ if eq $img_src "" }} + {{ $img_src = $src_link }} + {{ end }} + {{ $img_src_set = $img_src_set | append (printf "%s %dw" $src_link .) }} + {{ end }} + {{ $img_src_set = delimit $img_src_set "," }} + + {{ $block.Title }} + {{ end }} + {{ end }} +
+
+{{ end }} diff --git a/modules/wowchemy/layouts/partials/blocks/portfolio.html b/modules/wowchemy/layouts/partials/blocks/portfolio.html new file mode 100644 index 00000000..05a14d89 --- /dev/null +++ b/modules/wowchemy/layouts/partials/blocks/portfolio.html @@ -0,0 +1,106 @@ +{{/* Wowchemy Blocks: Portfolio */}} +{{/* Documentation: https://wowchemy.com/blocks/ */}} +{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}} + +{{/* Initialise */}} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} +{{ $columns := $block.design.columns | default "1" }} +{{ $view := $block.design.view | default "masonry" }} + +{{/* Require Isotope */}} +{{ $page.Page.Store.Set "has_isotope" true }} + +
+ + {{ with $block.content.text }}{{ . | markdownify }}{{ end }} + + {{ if $block.content.buttons }} + + {{ $filter_default := default (int $block.content.default_button_index) 0 }} + + {{/* Parse default filter tag from front matter in the form of either tag name or CSS class name. */}} + {{ $default_filter_item := (index $block.content.buttons ($filter_default)) }} + {{ $default_data_filter := "" }} + {{ with $default_filter_item.filter }} + {{ $default_data_filter = . }} + {{ else }} + {{ $default_filter_tag := $default_filter_item.tag }} + {{ if or (eq (substr $default_filter_tag 0 1) "*") (eq (substr $default_filter_tag 0 1) ".") }} + {{ $default_data_filter = $default_filter_tag }} + {{ else }} + {{ $default_data_filter = printf ".js-id-%s" (lower (replace $default_filter_tag " " "-")) }} + {{ end }} + {{end}} + + {{ $default_data_filter }} + + {{/* Only show filter buttons if there are multiple filters. */}} + {{ if gt (len $block.content.buttons) 1 }} +
+
+
+
+ {{ range $idx, $item := $block.content.buttons }} + {{/* Parse filter tag from front matter in the form of either tag name or CSS class name. */}} + {{ $data_filter := "" }} + {{ with .filter }} + {{ $data_filter = . }} + {{ else }} + {{ if or (eq (substr .tag 0 1) "*") (eq (substr .tag 0 1) ".") }} + {{ $data_filter = .tag }} + {{ else }} + {{ $data_filter = printf ".js-id-%s" (lower (replace .tag " " "-")) }} + {{ end }} + {{ end }} + {{ .name }} + {{ end }} +
+
+
+
+ {{ end }} + {{ end }} + +
+ + {{/* Query */}} + {{ $query := site.Pages }} + + {{/* Filters */}} + {{ with $block.content.page_type }} + {{/* Legacy filter, superseded by `filters.folders` */}} + {{ $query = where $query "Type" . }} + {{ end }} + {{ with $block.content.filters.folders }} + {{ $query = where $query "Section" "in" . }} + {{ end }} + {{ with $block.content.filters.tags }} + {{ $query = where $query "Params.tags" "intersect" . }} + {{ end }} + {{ with $block.content.filters.exclude_tags }} + {{ $query = $query | symdiff (where site.Pages "Params.tags" "intersect" .) }} + {{ end }} + {{ with ($block.content.filters.kinds | default (slice "page")) }} + {{ $query = where $query "Kind" "in" . }} + {{ end }} + + {{/* Sort */}} + {{ $sort_by := $block.content.sort_by | default "Date" }} + {{ $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 }} + + {{ range $index, $item := $query }} + {{ $js_tag_classes := delimit (apply (apply (apply $item.Params.tags "replace" "." " " "-") "printf" "js-id-%s" ".") "lower" ".") " " }} + {{ if in (slice "masonry" 3) $view }} +
+ {{else}} +
+ {{end}} + {{ partial "functions/render_view" (dict "page" $block "item" . "view" $view "index" $index) }} +
+ {{end}} + +
+