commit
1b717638c1
3 changed files with 13 additions and 1 deletions
2
Rules
2
Rules
|
@ -25,6 +25,8 @@ preprocess do
|
|||
ignore_old_content('blog', 'events', 'about/verslagen') if development?
|
||||
|
||||
update_blog_attributes
|
||||
convert_tags('Blog')
|
||||
convert_tags('Events')
|
||||
create_yearly_items('Blog')
|
||||
create_yearly_items('Events')
|
||||
create_tagly_items('Blog')
|
||||
|
|
|
@ -24,7 +24,7 @@ module EventsHelper
|
|||
|
||||
def all_events_by_tag(tag = nil, soon = nil)
|
||||
@items.find_all('/events/*/*.md')
|
||||
.filter{|i| (i[:tags] || []).include? tag }
|
||||
.filter { |i| (i[:tags] || []).include? tag }
|
||||
.select { |x| x[:soon] == soon }
|
||||
.sort_by { |x| x[:time] }
|
||||
end
|
||||
|
|
|
@ -120,6 +120,16 @@ module PreprocessHelper
|
|||
end
|
||||
end
|
||||
|
||||
def convert_tags(type)
|
||||
type = type.to_s
|
||||
@items.find_all("/#{type.downcase}/*/*").each do |item|
|
||||
if item.key?(:tags)
|
||||
item[:tags] = item[:tags]
|
||||
.map{ |tag| tag.split.map(&:capitalize).join(' ') }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def add_report_metadata
|
||||
@items.find_all('/about/verslagen/*/*').each do |report|
|
||||
report[:academic_year] = report.identifier.to_s.split('/')[-2]
|
||||
|
|
Loading…
Reference in a new issue