Placeholder for events without description
This commit is contained in:
parent
c47dba534c
commit
537178d991
3 changed files with 48 additions and 8 deletions
1
Rules
1
Rules
|
|
@ -3,6 +3,7 @@
|
|||
preprocess do
|
||||
expand_event_list("/_data/chaosevents/")
|
||||
expand_event_list("/_data/stammtisch/", "CCCS Stammtisch")
|
||||
expand_event_list("/_data/platzhalter/", nil, true)
|
||||
calculate_to_dates
|
||||
fix_timezones
|
||||
merge_location_data
|
||||
|
|
|
|||
37
content/_data/platzhalter.yaml
Normal file
37
content/_data/platzhalter.yaml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
events:
|
||||
- title: CCCS Vortragsabend (Thema noch offen)
|
||||
startdate: 2015-01-08T19:30:00Z
|
||||
duration: 2h
|
||||
location:
|
||||
location: bib
|
||||
- title: CCCS Vortragsabend (Thema noch offen)
|
||||
startdate: 2015-02-12T19:30:00Z
|
||||
duration: 2h
|
||||
location:
|
||||
location: bib
|
||||
- title: CCCS Vortragsabend (Thema noch offen)
|
||||
startdate: 2015-02-12T19:30:00Z
|
||||
duration: 2h
|
||||
location:
|
||||
location: bib
|
||||
- title: CCCS Vortragsabend (Thema noch offen)
|
||||
startdate: 2015-03-12T19:30:00Z
|
||||
duration: 2h
|
||||
location:
|
||||
location: bib
|
||||
- title: CCCS Vortragsabend (Thema noch offen)
|
||||
startdate: 2015-04-09T19:30:00Z
|
||||
duration: 2h
|
||||
location:
|
||||
location: bib
|
||||
- title: CCCS Vortragsabend (Thema noch offen)
|
||||
startdate: 2015-05-14T19:30:00Z
|
||||
duration: 2h
|
||||
location:
|
||||
location: bib
|
||||
- title: CCCS Vortragsabend (Thema noch offen)
|
||||
startdate: 2015-06-11T19:30:00Z
|
||||
duration: 2h
|
||||
location:
|
||||
location: bib
|
||||
|
|
@ -1,12 +1,14 @@
|
|||
def expand_event_list(itemId, defaultTitle = nil)
|
||||
def expand_event_list(itemId, defaultTitle = nil, skipIfDatePresent = false)
|
||||
@items[itemId][:events].each_with_index do |event,n|
|
||||
metadata = {
|
||||
:title => defaultTitle,
|
||||
:public => true
|
||||
}
|
||||
metadata.merge!(event)
|
||||
metadata[:kind]='event'
|
||||
@items << Nanoc::Item.new("<%= render 'event_body' %>", metadata, "#{itemId}#{n}/")
|
||||
if (!skipIfDatePresent || !@items.any?{ |i| i[:startdate]==event[:startdate] })
|
||||
metadata = {
|
||||
:title => defaultTitle,
|
||||
:public => true
|
||||
}
|
||||
metadata.merge!(event)
|
||||
metadata[:kind]='event'
|
||||
@items << Nanoc::Item.new("<%= render 'event_body' %>", metadata, "#{itemId}#{n}/")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue