Merge branch 'master' into timeline

This commit is contained in:
Niko Strijbol 2019-08-29 12:42:26 +02:00
commit 546980087e
No known key found for this signature in database
GPG key ID: 1A8AEBABD9012251
5 changed files with 23 additions and 2 deletions

2
Rules
View file

@ -41,7 +41,7 @@ end
# ARCHIVES
#
compile '/blog/*' do
layout '/archive_page.*'
layout '/blogs.*'
layout '/generic.*'
layout '/default.*'
filter :erb

View file

@ -34,6 +34,14 @@
<%= render '/partials/_blog_preview.*', post: post %>
<% end %>
</div>
</div>
<% if posts_in_year(@item[:academic_year]).empty? %>
<div class="content has-text-centered">
<h1>Sorry.</h1>
<h2>No blog posts yet this year.</h2>
<h4 class="has-text-grey"><i>Soon TM.<i></h4>
</div>
<% end %>
</div>
</div>

View file

@ -52,5 +52,13 @@
</div>
<% end %>
<% end %>
<% if past_events(@item[:academic_year]).empty? and upcoming_events(@item[:academic_year]).empty? %>
<div class="content has-text-centered">
<h1>Sorry.</h1>
<h2>No events planned yet this year.</h2>
<h4 class="has-text-grey"><i>Soon TM.<i></h4>
</div>
<% end %>
</div>
</div>

View file

@ -6,6 +6,8 @@ module ArchiveHelper
.map { |i| i.identifier.to_s[/\d\d-\d\d/] })
.to_a
.sort
.push(@config[:academic_year])
.uniq
end
def academic_years_blog_items

View file

@ -46,7 +46,10 @@ module PreprocessHelper
def create_yearly_items(type)
type = type.to_s
years = @items.find_all("/#{type.downcase}/*/*").map { |i| i.identifier.to_s[/\d\d-\d\d/] }.uniq
years = @items.find_all("/#{type.downcase}/*/*")
.map { |i| i.identifier.to_s[/\d\d-\d\d/] }
.push(@config[:academic_year])
.uniq
years.each do |year|
@items.create(