Skip to main

Event Filters

src/filters/events.js

Upcoming

isFuture()

Check that the page/event has a start date in the future (or today)

Params:

  • page {event object}

Example:

{%- if event | isFuture -%}
  <strong>{{ utility.datetime(event.date) }}</strong>
{%- else -%}
  {{ utility.datetime(event.date) }}
{%- endif %}

getFuture()

Return only the pages/events in the future

Params:

  • events {array of events}

Example:

{% set events = events | getFuture if events else none %}

List

buildEvent()

Build an event-page out of combined event and page data, so that events can be treated as a page of their own

Params:

  • page {11ty page object}
  • event {object}

Example:

{% set first_event = page | buildEvent(page.data.events[0]) %}

pageEvents()

Turn page events into a structured event collection

Params:

  • page {11ty page}

Example:

{{ events.list(
  'Page Events',
  collections.all | getCollectionItem(page) | pageEvents
) }}

getEvents()

Turn events from multiple pages into a structured event collection

Params:

  • collection {11ty collection}

Example:

{{ events.section(
  title='Upcoming Events',
  events=collections.all | getEvents | getFuture,
  all=false
) }}

birdEvents()

Group events by Bird

Params:

  • events {collection of events}

See Also