{{ $ := .root }} {{ $page := .page }}

{{ with $page.Title }}{{ . | markdownify }}{{ end }}

{{ with $page.Params.subtitle }}

{{ . | markdownify }}

{{ end }}
{{ with $page.Content }}

{{ . | markdownify }}

{{ end }} {{ if $page.Params.filter }} {{ $filter_default := default (int $page.Params.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 $page.Params.filter ($filter_default)).tag }} {{ $default_filter_tag := printf ".%s" (urlize $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 $page.Params.filter) 1 }}
{{ range $idx, $item := $page.Params.filter }} {{/* Parse filter tag from front matter in the form of either tag name or CSS class name. */}} {{ if or (eq (substr .tag 0 1) "*") (eq (substr .tag 0 1) ".") }} {{ $.Scratch.Set "tag" .tag }} {{ else }} {{ $.Scratch.Set "tag" (printf ".%s" (urlize .tag)) }} {{ end }} {{ .name }} {{ end }}
{{ end }} {{ end }} {{ if eq $page.Params.view 0 }}
{{ range where $.Site.RegularPages "Type" ($page.Params.folder | default "project") }}
{{ if .Content }} {{ else }} {{ with .Params.external_link }}{{ end }} {{ end }} {{ .Title }} {{ if .Content }}{{ else }}{{ with .Params.external_link }}{{ end }}{{ end }} {{ with .Params.summary }}

{{ . | markdownify }}

{{ end }}
{{ end }}
{{ else }}
{{ range $project := where $.Site.RegularPages "Type" ($page.Params.folder | default "project") }} {{ $.Scratch.Set "project_url" $project.RelPermalink }} {{ $.Scratch.Set "target" "" }} {{ if $project.Params.external_link }} {{ $.Scratch.Set "project_url" $project.Params.external_link }} {{ $.Scratch.Set "target" "target=\"_blank\"" }} {{ end }}
{{ with $project.Params.image_preview }} {{ end }}

{{ .Title }}

{{ with $project.Params.summary }}

{{ . | markdownify }}

{{ end }}
{{ end }}
{{ end }}