{{ $item.Title }}
{{/* Summary */}} {{ with $item.Params.summary }}{{ . }}
{{ else }}{{ $item.Summary | truncate 100 }}
{{ end }} {{/* Tech Stack Tags - fixed 2-line height for consistency */}} {{ with $item.Params.tech_stack }}{{/* Hugo Blox: Portfolio */}} {{/* Documentation: https://hugoblox.com/blocks/ */}} {{/* License: https://github.com/HugoBlox/kit/blob/main/LICENSE.md */}} {{/* Initialise */}} {{ $page := .wcPage }} {{ $block := .wcBlock }} {{/* Enable Alpine.js and animations for this block */}} {{ $page.Store.Set "has_alpine" true }} {{ if ne $block.design.animations false }} {{ $page.Store.Set "has_animations" true }} {{ end }} {{/* Query projects */}} {{ $query := site.Pages }} {{ $folders := $block.content.filters.folders | default (slice "projects") }} {{ $query = where $query "Section" "in" $folders }} {{ $query = where $query "Kind" "eq" "page" }} {{/* Get archive page for "View All" link */}} {{ $archive_page := "" }} {{ $main_folder := index $folders 0 }} {{ $archive_page = site.GetPage "Section" $main_folder }} {{/* 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 false }} {{ $sort_order := cond $sort_ascending "asc" "desc" }} {{ $query = sort $query $sort_by $sort_order }} {{/* Store total count before limiting */}} {{ $total_count := len $query }} {{/* Limit */}} {{ $count := $block.content.count | default 6 }} {{ if gt $count 0 }} {{ $query = first $count $query }} {{ end }} {{/* Get filter buttons */}} {{ $buttons := $block.content.buttons | default (slice (dict "name" "All" "tag" "*")) }} {{ $default_idx := $block.content.default_button_index | default 0 }} {{ $default_tag := "*" }} {{ with index $buttons $default_idx }} {{ $default_tag = .tag }} {{ end }} {{/* Columns */}} {{ $columns := $block.design.columns | default 3 }} {{ $grid_class := "md:grid-cols-2 lg:grid-cols-3" }} {{ if eq $columns 2 }} {{ $grid_class = "md:grid-cols-2" }} {{ else if eq $columns 4 }} {{ $grid_class = "md:grid-cols-2 lg:grid-cols-4" }} {{ end }}
{{ . | emojify | $page.RenderString }}
{{ end }}{{ . }}
{{ else }}{{ $item.Summary | truncate 100 }}
{{ end }} {{/* Tech Stack Tags - fixed 2-line height for consistency */}} {{ with $item.Params.tech_stack }}