unshift

Table of contents

Prepends object to the front of an array, moving other elements upwards.

{{ "Paul, George, Ringo" | split: ", " | unshift: "John" | join: ", " }}
Input
"John, Paul, George, Ringo"
Output

This filter also works on arrays witobjects, generated by Plate:

{{ site.pages | unshift: page }}

Need help?

Do you have any question which is not answered in this knowledge base? Contact us. We are here to help you.