Merge location data in events
This commit is contained in:
parent
58a5b4b7d5
commit
73ece643ca
2 changed files with 14 additions and 0 deletions
1
Rules
1
Rules
|
|
@ -3,6 +3,7 @@
|
||||||
preprocess do
|
preprocess do
|
||||||
generate_archive_pages
|
generate_archive_pages
|
||||||
generate_twitter_archive_pages
|
generate_twitter_archive_pages
|
||||||
|
merge_location_data()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
13
lib/location.rb
Normal file
13
lib/location.rb
Normal file
|
|
@ -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
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue