Skip to main

Bird Filters

src/filters/birds.js

Filtering data related to individual Odd Birds

Pages

byBird()

Get all the pages where a given bird is one of the authors

Params:

  • collection {array}

    containing 11ty page objects

  • bird {string}

    The name of the bird (as used in author settings)

  • solo {boolean} = false

    Optionally remove oddbird-authored pages from the collection

Example:

{{ collections.all | byBird('miriam') }}

authorPage()

Return the home page of a given author

Params:

  • collection {array}

    containing 11ty page objects

  • bird {string}

    The name of the bird (as used in author settings)

Example:

{{ collections.all | authorPage('miriam') }}

Status

active()

Return all active bird pages in a collection, sorted by active date.

Params:

  • collection {array}

    containing 11ty page objects

  • current {boolean} = true

    Flip result to show inactive birds

Example:

{{ collections.birds | active }}

activeAuthor()

Check if any author of a page is currently active (if ‘oddbird’ is an author, this will return true)

Params:

  • page {11ty page object}
  • all {array}

    Any collection that includes the author pages, such as collections.all

Example:

{{ post | activeAuthor(collections.all) }}

withActiveAuthor()

Filter a collection to only include pages with a currently active author. (if ‘oddbird’ is an author, this will return true)

Params:

  • collection {11ty collection}

    The collection to filter

  • all {array}

    Any collection that includes the author pages, such as collections.all

Example:

{{ collections.oss | withActiveAuthor(collections.all) }}

See Also