Skip to main

Post Macros

content/_includes/post.macros.njk


lists

by_year()

Group posts by year, when there are more than a set (above) number of posts

Params:

  • posts {array}

    containing 11ty page objects

  • collections {11ty collections object} = none
  • above {number} = 6
  • pagination {11ty pagination object} = none

list()

Generate a list of posts

Params:

  • posts {array}

    containing 11ty page objects

  • collections {11ty collections object} = none
  • title {string} = Resources
  • pagination {11ty pagination object} = none

posts

item()

Generate each post in a list

Params:

  • post {11ty page object}
  • collections {11ty collections object} = none
  • feature {boolean | 'large'} = none

detail()

Content for posts in a list

Params:

  • post {11ty page object}
  • type {string} = none
  • collections {11ty collections object} = none

grid()

A simple grid of pages, without full “card” resource styling

Params:

  • pages {11ty collection}
  • level {number (1-6)} = 3

    Heading level for page titles

  • collections {11ty collections object} = none

events

upcoming()

Listof upcoming events from a post

Params:

  • events {array}
  • links {boolean} = true

    Optionally remove event links for content in linked-cards

metadata

hero()

Display hero image for a post

Params:

  • image {object}
  • type {large | card | page} = large

byline()

Generate the post byline with type, authors, venue/client, date, and location

Params:

  • post {11ty page object}
  • collections {11ty collections object} = none
  • links {boolean} = true

    Optionally remove links for content in linked cards

  • dateformat {false | string}

    Optionally show the date in a given format

title()

Generate a linked heading with the post title

Params:

  • post {11ty page object}

subtitle()

Generate each post in a list

Params:

  • post {11ty page object}
  • collections {11ty collections object} = none

by()

Show a linked list of authors

Params:

  • author {string | array}
  • collections {11ty collections object}

pubdate()

Generate a pubdate in the proper format

Params:

  • start {date}
  • end {date}
  • format {string} = long

client()

Show the client name on a client project

Params:

  • name {string}

where()

Show the address when available

Params:

  • adr {string}

linked()

Link to original post or venue

Params:

  • venue {string}
  • url {url}

taglist()

Show a linked list of all post tags, as pills

Params:

  • tags {array}
  • collections {11ty collections object}

pagination

page_current()

Show the current active page number & total page-count in a paginated list

Params:

  • pagination {11ty pagination object} = none
  • prefix {string | none} = none

    Prefix “x of y” with more context, e.g. “page x of y”


See Also: