Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion modules/blox/blox/content-collection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions modules/blox/layouts/_partials/views/event-row--end.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
</div>
2 changes: 2 additions & 0 deletions modules/blox/layouts/_partials/views/event-row--start.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{/* Wrapper for the event-row view: a centred, narrow reading-width column. */}}
<div class="mt-8 sm:mt-12 w-full max-w-3xl mx-auto flex flex-col gap-4">
43 changes: 43 additions & 0 deletions modules/blox/layouts/_partials/views/event-row.html
Original file line number Diff line number Diff line change
@@ -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 }}

<div class="flex gap-4 rounded-xl bg-white dark:bg-zinc-900 ring-1 ring-zinc-900/5 dark:ring-white/10 shadow-sm p-4">
{{ with $resource }}
<a href="{{ $link }}" class="flex-shrink-0 self-start">
{{/* White chip even in dark mode: many event/press logos bake in a white background */}}
<img src="{{ .RelPermalink }}" alt="{{ $item.Title | plainify }} logo" loading="lazy"
class="h-14 w-14 object-contain rounded-md bg-white ring-1 ring-zinc-900/5 dark:ring-white/10 p-1">
</a>
{{ end }}
<div class="min-w-0 flex-1">
<h3 class="font-semibold text-zinc-900 dark:text-zinc-100 leading-snug">
<a href="{{ $link }}" class="hover:underline">{{ $item.Title }}</a>
</h3>
{{/* Stacked on narrow screens, inline (with a separator) from sm: up, so a
wrapped line never opens with a lone "Β·" separator. */}}
<div class="mt-0.5 flex flex-col sm:flex-row sm:items-center gap-y-0.5 sm:gap-x-2 text-sm text-zinc-600 dark:text-zinc-400">
<span>{{ $event_dates | safeHTML }}</span>
{{ with $item.Params.location }}
<span class="hidden sm:inline" aria-hidden="true">&middot;</span>
<span>{{ . }}</span>
{{ end }}
</div>
{{ with $summary }}
{{/* DIV, not P: a multi-paragraph summary renders as block <p>s that would
break out of (and escape) a <p> wrapper. */}}
<div class="mt-2 text-sm text-zinc-600 dark:text-zinc-400 line-clamp-3">{{ . }}</div>
{{ end }}
</div>
</div>