commit
c2a1000a29
12 changed files with 134 additions and 16 deletions
2
Rules
2
Rules
|
@ -24,6 +24,8 @@ preprocess do
|
||||||
update_blog_attributes
|
update_blog_attributes
|
||||||
create_yearly_items('Blog')
|
create_yearly_items('Blog')
|
||||||
create_yearly_items('Events')
|
create_yearly_items('Events')
|
||||||
|
create_tagly_items('Blog')
|
||||||
|
create_tagly_items('Events')
|
||||||
convert_event_time_to_timestamps
|
convert_event_time_to_timestamps
|
||||||
|
|
||||||
all_events.each do |event|
|
all_events.each do |event|
|
||||||
|
|
|
@ -3,6 +3,8 @@ title: "Zeus en Corona"
|
||||||
created_at: 11-03-2020
|
created_at: 11-03-2020
|
||||||
description: Corona en de invloed ervan op Zeus WPI
|
description: Corona en de invloed ervan op Zeus WPI
|
||||||
author: Robbe Van Herck
|
author: Robbe Van Herck
|
||||||
|
tags:
|
||||||
|
- Corona
|
||||||
---
|
---
|
||||||
Beste Zeussers en Zeusinnen,
|
Beste Zeussers en Zeusinnen,
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@ title: "Het vervolg op het avontuur van de Vleor"
|
||||||
created_at: 07-07-2020
|
created_at: 07-07-2020
|
||||||
description: Eindelijk, de Zeuskelder heeft weer een nieuwe vloer!
|
description: Eindelijk, de Zeuskelder heeft weer een nieuwe vloer!
|
||||||
toc: true
|
toc: true
|
||||||
|
tags:
|
||||||
|
- vloer
|
||||||
---
|
---
|
||||||
|
|
||||||
**vleor** (_de; m;_ meervoud: _vleoren_)
|
**vleor** (_de; m;_ meervoud: _vleoren_)
|
||||||
|
|
|
@ -3,6 +3,8 @@ title: "Zeusbestuur 2020-2021"
|
||||||
created_at: 6-7-2020
|
created_at: 6-7-2020
|
||||||
description: "Het gloriZeuse nieuw bestuur"
|
description: "Het gloriZeuse nieuw bestuur"
|
||||||
author: "Robbe Van Herck"
|
author: "Robbe Van Herck"
|
||||||
|
tags:
|
||||||
|
- Bestuur
|
||||||
---
|
---
|
||||||
|
|
||||||
> Hallo mijn naam is Jasper en ik zou nog steeds sysadmin willen blijven
|
> Hallo mijn naam is Jasper en ik zou nog steeds sysadmin willen blijven
|
||||||
|
@ -25,4 +27,3 @@ Voor iedereen die niet op de verkiezingen was of de uitslag vergeten is, hier ee
|
||||||
| Evenementen | Ruben De Facq |
|
| Evenementen | Ruben De Facq |
|
||||||
|
|
||||||
Veel succes en veel plezier van jullie oud bestuur. Het gaat gegarandeerd onvergetelijk worden! 🧡
|
Veel succes en veel plezier van jullie oud bestuur. Het gaat gegarandeerd onvergetelijk worden! 🧡
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,9 @@ title: "Wij coden voort"
|
||||||
created_at: 21-7-2020
|
created_at: 21-7-2020
|
||||||
description: "We mogen de kelder opnieuw openen"
|
description: "We mogen de kelder opnieuw openen"
|
||||||
author: "Jasper Devreker"
|
author: "Jasper Devreker"
|
||||||
|
tags:
|
||||||
|
- Corona
|
||||||
|
- General
|
||||||
---
|
---
|
||||||
|
|
||||||
We hebben via het WVK[^wvk] doorgekregen dat we onze geliefde kelder terug mogen openen.
|
We hebben via het WVK[^wvk] doorgekregen dat we onze geliefde kelder terug mogen openen.
|
||||||
|
|
|
@ -9,6 +9,8 @@ locationlink: $s9
|
||||||
facebook: //www.facebook.com/events/2759136070856741/
|
facebook: //www.facebook.com/events/2759136070856741/
|
||||||
banner: //zeus.ugent.be/zeuswpi/Itsb0YbN.png
|
banner: //zeus.ugent.be/zeuswpi/Itsb0YbN.png
|
||||||
header_text_background: true
|
header_text_background: true
|
||||||
|
tags:
|
||||||
|
- Code Hacking
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,4 +33,3 @@ Er kunnen snacks en drank gekocht worden op het event. Er zal ook om takeaway ge
|
||||||
|
|
||||||
[hacktob]: https://hacktoberfest.digitalocean.com/
|
[hacktob]: https://hacktoberfest.digitalocean.com/
|
||||||
[gandalf]: https://event.fkgent.be/events/305
|
[gandalf]: https://event.fkgent.be/events/305
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,8 @@ banner: //zeus.ugent.be/zeuswpi/7k6hvPJw.webp
|
||||||
image: //zeus.ugent.be/zeuswpi/a28GvLuO.png
|
image: //zeus.ugent.be/zeuswpi/a28GvLuO.png
|
||||||
header_text_background: true
|
header_text_background: true
|
||||||
header_text_background_color: 'rgba(80, 50, 80, 0.75)'
|
header_text_background_color: 'rgba(80, 50, 80, 0.75)'
|
||||||
|
tags:
|
||||||
|
- Esoterisch
|
||||||
---
|
---
|
||||||
|
|
||||||
UPDATE: datum veranderd naar 28 oktober!
|
UPDATE: datum veranderd naar 28 oktober!
|
||||||
|
|
|
@ -19,24 +19,41 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
<p class="menu-label">
|
||||||
|
Tag
|
||||||
|
</p>
|
||||||
|
<ul class="menu-list">
|
||||||
|
<% tag_blog_items.each do |tag, item| %>
|
||||||
|
<% if @item_rep && @item_rep.path == item.path %>
|
||||||
|
<li>
|
||||||
|
<a href="#" class="is-active">
|
||||||
|
<%= tag %>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<% else %>
|
||||||
|
<li>
|
||||||
|
<%= link_to tag, item %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
</aside>
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<div class="columns is-multiline">
|
<div class="columns is-multiline">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<% posts_in_year(item[:academic_year]).each_with_index.select {|e, i| i.even?}.map(&:first).each do |post| %>
|
<% posts_in_year_or_with_tag(item).each_with_index.select {|e, i| i.even?}.map(&:first).each do |post| %>
|
||||||
<%= render '/partials/_blog_preview.*', post: post %>
|
<%= render '/partials/_blog_preview.*', post: post %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<% posts_in_year(item[:academic_year]).each_with_index.reject {|e, i| i.even?}.map(&:first).each do |post| %>
|
<% posts_in_year_or_with_tag(item).each_with_index.reject {|e, i| i.even?}.map(&:first).each do |post| %>
|
||||||
<%= render '/partials/_blog_preview.*', post: post %>
|
<%= render '/partials/_blog_preview.*', post: post %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<% if posts_in_year(@item[:academic_year]).empty? %>
|
<% if posts_in_year_or_with_tag(item).empty? %>
|
||||||
<div class="content has-text-centered">
|
<div class="content has-text-centered">
|
||||||
<h1>Sorry.</h1>
|
<h1>Sorry.</h1>
|
||||||
<h2>No blog posts yet this year.</h2>
|
<h2>No blog posts yet this year.</h2>
|
||||||
|
|
|
@ -19,15 +19,33 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
<p class="menu-label">
|
||||||
|
Tag
|
||||||
|
</p>
|
||||||
|
<ul class="menu-list">
|
||||||
|
<% tag_event_items.each do |tag, item| %>
|
||||||
|
<% if @item_rep && @item_rep.path == item.path %>
|
||||||
|
<li>
|
||||||
|
<a href="#" class="is-active">
|
||||||
|
<%= tag %>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<% else %>
|
||||||
|
<li>
|
||||||
|
<%= link_to tag, item %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
</aside>
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<% unless upcoming_events(@item[:academic_year]).empty? %>
|
<% unless upcoming_events_in_year_or_tag(@item).empty? %>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h1>Upcoming events</h1>
|
<h1>Upcoming events</h1>
|
||||||
</div>
|
</div>
|
||||||
<% upcoming_events(@item[:academic_year]).each_slice(1) do |slice| %>
|
<% upcoming_events_in_year_or_tag(@item).each_slice(1) do |slice| %>
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<% slice.each do |event| %>
|
<% slice.each do |event| %>
|
||||||
<div class="tile is-parent ">
|
<div class="tile is-parent ">
|
||||||
|
@ -38,11 +56,11 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% unless past_events(@item[:academic_year]).empty? %>
|
<% unless past_events_in_year_or_tag(@item).empty? %>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h1>Past events</h1>
|
<h1>Past events</h1>
|
||||||
</div>
|
</div>
|
||||||
<% past_events(@item[:academic_year]).each_slice(1) do |slice| %>
|
<% past_events_in_year_or_tag(@item).each_slice(1) do |slice| %>
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<% slice.each do |event| %>
|
<% slice.each do |event| %>
|
||||||
<div class="tile is-parent ">
|
<div class="tile is-parent ">
|
||||||
|
@ -53,7 +71,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if past_events(@item[:academic_year]).empty? and upcoming_events(@item[:academic_year]).empty? %>
|
<% if past_events_in_year_or_tag(@item).empty? and upcoming_events_in_year_or_tag(@item).empty? %>
|
||||||
<div class="content has-text-centered">
|
<div class="content has-text-centered">
|
||||||
<h1>Sorry.</h1>
|
<h1>Sorry.</h1>
|
||||||
<h2>No events planned yet this year.</h2>
|
<h2>No events planned yet this year.</h2>
|
||||||
|
|
|
@ -3,8 +3,8 @@ module ArchiveHelper
|
||||||
# Set.to_a to prevent duplicates
|
# Set.to_a to prevent duplicates
|
||||||
Set.new(items
|
Set.new(items
|
||||||
.find_all('/blog/*/*')
|
.find_all('/blog/*/*')
|
||||||
.map { |i| i.identifier.to_s[/\d\d-\d\d/] })
|
.map { |i| i.identifier.to_s.split('/')[-2] })
|
||||||
.to_a
|
.to_a
|
||||||
.sort
|
.sort
|
||||||
.push(@config[:academic_year])
|
.push(@config[:academic_year])
|
||||||
.uniq
|
.uniq
|
||||||
|
@ -14,6 +14,15 @@ module ArchiveHelper
|
||||||
academic_years.reverse.map { |y| [y, items["/blog/#{y}.html"]] }
|
academic_years.reverse.map { |y| [y, items["/blog/#{y}.html"]] }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def tag_blog_items
|
||||||
|
Set.new(items
|
||||||
|
.find_all('/blog/*/*')
|
||||||
|
.flat_map { |i| i[:tags] || [] })
|
||||||
|
.to_a
|
||||||
|
.sort
|
||||||
|
.uniq.map { |y| [y, items["/blog/#{y.gsub(' ', '_')}.html"]]}
|
||||||
|
end
|
||||||
|
|
||||||
def pretty_year(year)
|
def pretty_year(year)
|
||||||
year = year.scan(/\d\d/)
|
year = year.scan(/\d\d/)
|
||||||
"'#{year[0]} - '#{year[1]}"
|
"'#{year[0]} - '#{year[1]}"
|
||||||
|
@ -22,4 +31,18 @@ module ArchiveHelper
|
||||||
def posts_in_year(y)
|
def posts_in_year(y)
|
||||||
items.find_all("/blog/#{y}/*").sort_by { |x| x[:created_at] }.reverse
|
items.find_all("/blog/#{y}/*").sort_by { |x| x[:created_at] }.reverse
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def posts_with_tag(tag)
|
||||||
|
items
|
||||||
|
.find_all('/blog/*/*')
|
||||||
|
.filter{|i| (i[:tags] || []).include? tag }
|
||||||
|
end
|
||||||
|
|
||||||
|
def posts_in_year_or_with_tag(item)
|
||||||
|
if item[:is_yearly]
|
||||||
|
posts_in_year(item[:academic_year])
|
||||||
|
else
|
||||||
|
posts_with_tag(item[:tag])
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,6 +13,22 @@ module EventsHelper
|
||||||
items_.select { |x| x[:soon] == soon }.sort_by { |x| x[:time] }
|
items_.select { |x| x[:soon] == soon }.sort_by { |x| x[:time] }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def tag_event_items
|
||||||
|
Set.new(items
|
||||||
|
.find_all('/events/*/*')
|
||||||
|
.flat_map { |i| i[:tags] || [] })
|
||||||
|
.to_a
|
||||||
|
.sort
|
||||||
|
.uniq.map { |y| [y, items["/events/#{y.gsub(' ', '_')}.html"]]}
|
||||||
|
end
|
||||||
|
|
||||||
|
def all_events_by_tag(tag = nil, soon = nil)
|
||||||
|
@items.find_all('/events/*/*.md')
|
||||||
|
.filter{|i| (i[:tags] || []).include? tag }
|
||||||
|
.select { |x| x[:soon] == soon }
|
||||||
|
.sort_by { |x| x[:time] }
|
||||||
|
end
|
||||||
|
|
||||||
def soon_events
|
def soon_events
|
||||||
all_events(nil, true)
|
all_events(nil, true)
|
||||||
end
|
end
|
||||||
|
@ -21,12 +37,28 @@ module EventsHelper
|
||||||
all_events(year).reject { |x| x[:time] <= Date.today }
|
all_events(year).reject { |x| x[:time] <= Date.today }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def upcoming_events_in_year_or_tag(item)
|
||||||
|
if item[:is_yearly]
|
||||||
|
upcoming_events(item[:academic_year])
|
||||||
|
else
|
||||||
|
all_events_by_tag(item[:tag]).reject { |x| x[:time] <= Date.today }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def past_events(year = nil)
|
def past_events(year = nil)
|
||||||
all_events(year).reject { |x| x[:time] > Date.today }.reverse
|
all_events(year).reject { |x| x[:time] > Date.today }.reverse
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def past_events_in_year_or_tag(item)
|
||||||
|
if item[:is_yearly]
|
||||||
|
past_events(item[:academic_year])
|
||||||
|
else
|
||||||
|
all_events_by_tag(item[:tag]).reject { |x| x[:time] > Date.today }.reverse
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def academic_years_event_items
|
def academic_years_event_items
|
||||||
items.find_all('/events/*').map { |e| [e[:academic_year], e] }.sort_by(&:first).reverse
|
items.find_all('/events/*').reject { |e| e[:academic_year].nil? }.map { |e| [e[:academic_year], e] }.sort_by(&:first).reverse
|
||||||
end
|
end
|
||||||
|
|
||||||
def grouped_events
|
def grouped_events
|
||||||
|
|
|
@ -56,7 +56,7 @@ module PreprocessHelper
|
||||||
i.update_attributes(
|
i.update_attributes(
|
||||||
# Tag all posts with article (for Blogging helper)
|
# Tag all posts with article (for Blogging helper)
|
||||||
kind: 'article',
|
kind: 'article',
|
||||||
academic_year: i.identifier.to_s[/\d\d-\d\d/],
|
academic_year: i.identifier.to_s[/\d-\d/],
|
||||||
created_at: Date.parse(i[:created_at])
|
created_at: Date.parse(i[:created_at])
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
@ -72,7 +72,7 @@ module PreprocessHelper
|
||||||
years.each do |year|
|
years.each do |year|
|
||||||
@items.create(
|
@items.create(
|
||||||
'',
|
'',
|
||||||
{ academic_year: year, title: type },
|
{ academic_year: year, title: type, is_yearly: true },
|
||||||
"/#{type.downcase}/#{year}.html"
|
"/#{type.downcase}/#{year}.html"
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
@ -84,6 +84,21 @@ module PreprocessHelper
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def create_tagly_items(type)
|
||||||
|
type = type.to_s
|
||||||
|
tags = @items.find_all("/#{type.downcase}/*/*")
|
||||||
|
.flat_map { |i| i[:tags] || [] }
|
||||||
|
.uniq
|
||||||
|
|
||||||
|
tags.each do |tag|
|
||||||
|
@items.create(
|
||||||
|
'',
|
||||||
|
{ tag: tag, title: type, is_yearly: false },
|
||||||
|
"/#{type.downcase}/#{tag.gsub(' ', '_')}.html"
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def convert_event_time_to_timestamps
|
def convert_event_time_to_timestamps
|
||||||
@items.find_all('/events/*/*.md').each do |event|
|
@items.find_all('/events/*/*.md').each do |event|
|
||||||
# HACK: Strings in a format like "2017-10-05T20:45:00+0200" automatically get converted to Time
|
# HACK: Strings in a format like "2017-10-05T20:45:00+0200" automatically get converted to Time
|
||||||
|
|
Loading…
Reference in a new issue