{{/* Portfolio Widget */}} {{/* Initialise */}} {{ $ := .root }} {{ $st := .page }} {{ $items_type := $st.Params.content.page_type | default "project" }} {{ $columns := $st.Params.design.columns | default "2" }} {{ if ne $columns "1" }} {{/* Standard dual-column layout. */}}
{{ with $st.Title }}

{{ . | markdownify | emojify }}

{{ end }} {{ with $st.Params.subtitle }}

{{ . | markdownify | emojify }}

{{ end }}
{{ else }} {{/* Single column layout. */}}
{{ with $st.Title }}

{{ . | markdownify | emojify }}

{{ end }} {{ with $st.Params.subtitle }}

{{ . | markdownify | emojify }}

{{ end }}
{{ end }} {{ with $st.Content }}

{{ . }}

{{ end }} {{ if $st.Params.content.filter_button }} {{ $filter_default := default (int $st.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_tag_raw := (index $st.Params.content.filter_button ($filter_default)).tag }} {{ $default_filter_tag := printf ".js-id-%s" (replace $default_filter_tag_raw " " "-") }} {{ if or (eq (substr $default_filter_tag_raw 0 1) "*") (eq (substr $default_filter_tag_raw 0 1) ".") }} {{ $default_filter_tag = $default_filter_tag_raw }} {{ end }} {{ $default_filter_tag }} {{/* Only show filter buttons if there are multiple filters. */}} {{ if gt (len $st.Params.content.filter_button) 1 }}
  • {{ range $idx, $item := $st.Params.content.filter_button }} {{/* Parse filter tag from front matter in the form of either tag name or CSS class name. */}} {{ $data_filter := printf ".js-id-%s" (replace .tag " " "-") }} {{ if or (eq (substr .tag 0 1) "*") (eq (substr .tag 0 1) ".") }} {{ $data_filter = .tag }} {{ end }} {{ .name }} {{ end }}
{{ end }} {{ end }}
{{ range $idx, $item := where site.RegularPages "Type" $items_type }} {{ $link := $item.RelPermalink }} {{ $target := "" }} {{ if $item.Params.external_link }} {{ $link = $item.Params.external_link }} {{ $target = "target=\"_blank\" rel=\"noopener\"" }} {{ end }} {{ if eq $st.Params.design.view 1 }} {{ partial "project_li_list" (dict "widget" $st "index" $idx "item" $item "link" $link "target" $target) }} {{ else if eq $st.Params.design.view 3 }} {{ partial "project_li_card" (dict "widget" $st "index" $idx "item" $item "link" $link "target" $target) }} {{ else }} {{ partial "project_li_showcase" (dict "widget" $st "index" $idx "item" $item "link" $link "target" $target) }} {{ end }} {{ end }}