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 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 }} +
+