diff --git a/Rules b/Rules index c066e33b..1428af4c 100644 --- a/Rules +++ b/Rules @@ -3,6 +3,7 @@ preprocess do generate_archive_pages generate_twitter_archive_pages + merge_location_data() end diff --git a/lib/location.rb b/lib/location.rb new file mode 100644 index 00000000..23777b4b --- /dev/null +++ b/lib/location.rb @@ -0,0 +1,13 @@ +def merge_item_location_data(location) + if (location && location[:location]) + templates = @items['/_data/locations/'].attributes + if templates[location[:location].to_sym] + location.merge!(templates[location[:location].to_sym]) + end + end +end + +def merge_location_data() + items.select { |i| i[:kind] == 'event' }.each { |e| merge_item_location_data(e[:location]) } +end +