Skip to content

Instantly share code, notes, and snippets.

@IanMitchell
Created June 5, 2016 18:43
Show Gist options
  • Save IanMitchell/9e4dd77cdb4fdcdca2c55735eab6208b to your computer and use it in GitHub Desktop.
Save IanMitchell/9e4dd77cdb4fdcdca2c55735eab6208b to your computer and use it in GitHub Desktop.
Concat Plugin for Jekyll
module Jekyll
module ConcatFilter
# Public: Combines two arrays
#
# first_array - The initial Array to use
# second_array - The Array to add
#
# Examples
#
# {{ site.data.disney_movies | concat: site.data.pixar_movies }}
# # => ['Frozen', 'Up']
#
# Returns a new Array
def concat(first_array, second_array)
first_array + second_array
end
end
end
Liquid::Template.register_filter(Jekyll::ConcatFilter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment