renderizer

Array Filters

Array filters are NON-DESTRUCTIVE

Inspect page tags

{{ page.tags | inspect }}

Should render: [“Seattle”, “Tacoma”]

Render: ["Seattle", "Tacoma"]

Push

Add as last.

{{ page.tags | push: 'Spokane' | inspect }}

Should render: [‘Seattle’, ‘Tacoma’, ‘Spokane’]

Render: ["Seattle", "Tacoma", "Spokane"]

Pop

Take the first.

{{ page.tags | pop | inspect }}

Should render: [‘Seattle’]

Render: ["Seattle"]

Shift

Take the last.

{{ page.tags | shift | inspect }}

from ["Seattle", "Tacoma"]

Should render: [‘Tacoma’]

Render: ["Tacoma"]

Unshift

Add as first.

{{ page.tags | unshift: "Olympia" | inspect }}

Should render: [‘Olympia’, ‘Seattle’, ‘Tacoma’]

Render: ["Olympia", "Seattle", "Tacoma"]