From e5440094cdd0725c95a19d0fab5ef26f43091347 Mon Sep 17 00:00:00 2001 From: Vidminas <5411598+Vidminas@users.noreply.github.com> Date: Thu, 9 Jul 2026 22:40:56 +0100 Subject: [PATCH 1/2] feat(views): add a compact "event-row" collection view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a reusable compact row view (logo · title · date · location · summary) for talks/events/press lists — none of the existing views (card, article-grid, citation, date-title-summary, slides-gallery) is a compact horizontal row. - Uses the existing get_featured_image / get_event_dates / get_summary helpers. - Date + location stack on narrow screens and go inline with a separator from sm: up, so a wrapped line never opens with a lone separator. - Logo sits on a white chip even in dark mode (many event/press logos bake in a white background). - Summary is wrapped in a
(not

) to support multi-paragraph output. Co-Authored-By: Claude Opus 4.8 --- .../_partials/views/event-row--end.html | 1 + .../_partials/views/event-row--start.html | 2 + .../layouts/_partials/views/event-row.html | 43 +++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 modules/blox/layouts/_partials/views/event-row--end.html create mode 100644 modules/blox/layouts/_partials/views/event-row--start.html create mode 100644 modules/blox/layouts/_partials/views/event-row.html diff --git a/modules/blox/layouts/_partials/views/event-row--end.html b/modules/blox/layouts/_partials/views/event-row--end.html new file mode 100644 index 000000000..04f5b8449 --- /dev/null +++ b/modules/blox/layouts/_partials/views/event-row--end.html @@ -0,0 +1 @@ +

diff --git a/modules/blox/layouts/_partials/views/event-row--start.html b/modules/blox/layouts/_partials/views/event-row--start.html new file mode 100644 index 000000000..b3998b922 --- /dev/null +++ b/modules/blox/layouts/_partials/views/event-row--start.html @@ -0,0 +1,2 @@ +{{/* Wrapper for the event-row view: a centred, narrow reading-width column. */}} +
diff --git a/modules/blox/layouts/_partials/views/event-row.html b/modules/blox/layouts/_partials/views/event-row.html new file mode 100644 index 000000000..32206cfee --- /dev/null +++ b/modules/blox/layouts/_partials/views/event-row.html @@ -0,0 +1,43 @@ +{{/* Compact row view: a small logo beside the title, date and location, with + the summary below. Suited to talks / events / press lists. */}} +{{ $item := .item }} +{{ $link := $item.RelPermalink }} +{{ $resource := partial "functions/get_featured_image.html" $item }} +{{ $isEvent := eq $item.Type "events" }} +{{ $event_dates := "" }} +{{ if $isEvent }} + {{ $event_dates = partial "functions/get_event_dates" $item }} +{{ else }} + {{ $event_dates = $item.Date | time.Format (site.Params.hugoblox.locale.date_format | default ":date_long") }} +{{ end }} +{{ $summary := partial "functions/get_summary" $item }} +{{ $summary = $summary | page.RenderString }} + +
+ {{ with $resource }} + + {{/* White chip even in dark mode: many event/press logos bake in a white background */}} + {{ $item.Title | plainify }} logo + + {{ end }} +
+

+ {{ $item.Title }} +

+ {{/* Stacked on narrow screens, inline (with a separator) from sm: up, so a + wrapped line never opens with a lone "·" separator. */}} +
+ {{ $event_dates | safeHTML }} + {{ with $item.Params.location }} + + {{ . }} + {{ end }} +
+ {{ with $summary }} + {{/* DIV, not P: a multi-paragraph summary renders as block

s that would + break out of (and escape) a

wrapper. */}} +

{{ . }}
+ {{ end }} +
+
From a8b0c8c9dce43a9a31ff79d00f344d800774d6c3 Mon Sep 17 00:00:00 2001 From: Vidminas <5411598+Vidminas@users.noreply.github.com> Date: Sat, 11 Jul 2026 08:55:30 +0100 Subject: [PATCH 2/2] docs(content-collection): document collection views incl. event-row Add an "Available Views" reference table to the Collection block README covering all six views (card, article-grid, citation, date-title-summary, slides-gallery, event-row) with a "best for" note, a layout description, and a front-matter usage example. Also corrects the "Multiple Views" feature bullet, which listed view names (compact, showcase, list, masonry) that never matched the actual view slugs. Co-Authored-By: Claude Opus 4.8 --- .../blox/blox/content-collection/README.md | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/modules/blox/blox/content-collection/README.md b/modules/blox/blox/content-collection/README.md index 7db1a7603..cdd0aa869 100644 --- a/modules/blox/blox/content-collection/README.md +++ b/modules/blox/blox/content-collection/README.md @@ -8,7 +8,7 @@ The Collection block is your ultimate content curation tool, designed to showcas - **Smart Filtering**: Filter by folders, tags, categories, authors, publication types, and more - **Flexible Sorting**: Sort by date, title, or any custom field in ascending or descending order -- **Multiple Views**: Choose from card, compact, showcase, citation, list, or masonry layouts +- **Multiple Views**: Choose from `card`, `article-grid`, `citation`, `date-title-summary`, `slides-gallery`, or `event-row` layouts — see [Available Views](#-available-views) - **Pagination Ready**: Built-in support for limiting items and pagination - **Archive Integration**: Automatic "See All" links to full archive pages - **Responsive Design**: Perfectly optimized for all screen sizes @@ -21,6 +21,26 @@ The Collection block is your ultimate content curation tool, designed to showcas - **News & Updates**: Keep visitors informed with filtered content streams - **Content Archives**: Create organized content hubs by topic or category +## 🖼️ Available Views + +Set `view` in a section's `_index.md` front matter (or `design.view` on a Collection block) to +control how items are rendered. Views are resolved by name; an unrecognised value falls back to +`card`. + +| `view` | Best for | Layout | +|--------|----------|--------| +| `card` _(default)_ | Blog posts, projects | Cover-image cards (title, summary, metadata) stacked in a single reading-width column. | +| `article-grid` | Portfolios, showcases | The same cards arranged in a responsive multi-column grid (`columns` configurable). | +| `citation` | Publications | Formatted APA/MLA citation rows (authors · year · title · venue) with attachment links. | +| `date-title-summary` | News, changelogs | Minimal chronological list: date, title, and a short summary with a "Read more" link. | +| `slides-gallery` | Slide decks | 16:9 thumbnails with a play overlay and slide count. | +| `event-row` | Talks, events, press | Compact row: logo · title · date · location, with the summary beneath. | + +```yaml +# In the collection's `_index.md` front matter: +view: event-row +``` + ## 🚀 Why Choose Collection Block? **Effortless Content Management**: No manual updates needed - your content automatically appears as you publish