diff --git a/README.md b/README.md index 22fbe3f..2991b0f 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,16 @@ # zeus.ugent.be [![Build Status](https://travis-ci.org/ZeusWPI/zeus.ugent.be.svg?branch=master)](https://travis-ci.org/ZeusWPI/zeus.ugent.be) -## Installation +## Setup + +### Installation ```bash bundle install npm install ``` -## Developing +### Developing ```bash bundle exec nanoc live @@ -16,7 +18,7 @@ bundle exec nanoc live This will spawn a webserver, and automatically recompile the site when files get changed. -## Deploying +### Deploying The latest builds on master get deployed automatically using [travis](https://travis-ci.org). @@ -25,3 +27,53 @@ For manual deployment, run ```bash bundle exec nanoc deploy --target public ``` + +## Events + +Example structure: + +``` +content/ + assets/ + events/ + 15-16/ + 16-17/ + battlebots/ + main.md + intro.md + codenight.md + finale.md + awk.md + sed.md + ruby.md + index.erb +``` + +### Metadata + +Every event is a `.md` file with the following metadata tags: + +#### Required + +* title: String +* time: Date +* location: String + +#### Optional + +* banner: URL + +### Grouped events + +If there's a series of events (for example summer code nights) these can be grouped by creating a folder containing a `main.md`, which will need the following metadata: + +#### Required + +* title: String + +#### Optional + +* location: String +* banner: URL + +Other `.md` files made in that folder are sub-events which need to fit the [metadata description listed earlier](#metadata) diff --git a/Rules b/Rules index 051ffb4..b894eac 100644 --- a/Rules +++ b/Rules @@ -68,9 +68,9 @@ compile '/archives/*' do end # -# POSTS +# EVENTS # -compile '/posts/**/*' do +compile '/events/**/*' do filter :kramdown layout '/eventpost.*' @@ -80,15 +80,36 @@ compile '/posts/**/*' do filter :relativize_paths, type: :html end -compile '/posts/**/*', rep: :text do +compile '/events/**/*', rep: :text do filter :kramdown filter :strip_html end -compile '/posts/**/*', rep: :ical do +compile '/events/**/main.md', rep: :ical do +end + +compile '/events/**/*', rep: :ical do filter :ical end +# +# POSTS +# +compile '/posts/**/*' do + filter :kramdown + + layout '/blogpost.*' + layout '/generic.*' + layout '/default.*' + + filter :relativize_paths, type: :html +end + +compile '/posts/**/*', rep: :text do + filter :kramdown + filter :strip_html +end + # # GENERIC ERB PAGES # @@ -141,7 +162,7 @@ route '/assets/scripts/**/*' do end # POSTS -route '/posts/**/*', rep: :ical do +route '/events/**/*', rep: :ical do "#{item.identifier.without_ext}.ics" end diff --git a/content/assets/stylesheets/includes/general.scss b/content/assets/stylesheets/includes/general.scss index 6475a5c..8b5e42d 100644 --- a/content/assets/stylesheets/includes/general.scss +++ b/content/assets/stylesheets/includes/general.scss @@ -10,15 +10,27 @@ html, body { } } + #navbar { - .nav-item { - transition: 0.2s; + align-items: flex-end; - font-variant: small-caps; - font-size: 1.25em; - - &:hover { + #logo-link { + #logo { + width: 100px; + } + } + .nav { + height: 100%; + align-items: flex-end; + .nav-item { transition: 0.2s; + + font-variant: small-caps; + font-size: 1.25em; + + &:hover { + transition: 0.2s; + } } } } diff --git a/content/posts/15-16/awk.md b/content/events/15-16/awk.md similarity index 100% rename from content/posts/15-16/awk.md rename to content/events/15-16/awk.md diff --git a/content/events/15-16/bottlebats/intro.md b/content/events/15-16/bottlebats/intro.md new file mode 100644 index 0000000..e610340 --- /dev/null +++ b/content/events/15-16/bottlebats/intro.md @@ -0,0 +1,5 @@ +--- +title: Bottle Bats Introductie +time: 12-3-16 +location: Grace Hopper +--- diff --git a/content/events/15-16/bottlebats/main.md b/content/events/15-16/bottlebats/main.md new file mode 100644 index 0000000..c321015 --- /dev/null +++ b/content/events/15-16/bottlebats/main.md @@ -0,0 +1,3 @@ +--- +title: Bottle Bats +--- diff --git a/content/index.erb b/content/index.erb index 048aec5..d2432f2 100644 --- a/content/index.erb +++ b/content/index.erb @@ -1,13 +1,13 @@
-
+
<%= render '/partials/_tile.*', article: sorted_articles[0] %>
<% sorted_articles[1..-1].each do |article| %>
-
+
<%= render '/partials/_tile.*', article: article %>
diff --git a/content/posts/15-16/xtext.md b/content/posts/15-16/xtext.md index c45efea..85da46a 100644 --- a/content/posts/15-16/xtext.md +++ b/content/posts/15-16/xtext.md @@ -1,9 +1,6 @@ --- title: Xtext Workshop -banner: https://zeus.ugent.be/wp-content/uploads/2016/04/450px-Xtext_logo.png created_at: 01-04-2016 -time: 26-04-2016 -location: Auditorium A2, Campus Sterre, Gebouw S9 --- Op **26 april om 18:00 in Auditorium A2, Campus Sterre, Gebouw S9** organiseren we een workshop over [Xtext](https://eclipse.org/Xtext/). **Xtext** is een framework om nieuwe domein-specifieke computertalen (**DSLs**) mee te ontwerpen. Een **DSL** kan een nieuwe programmeertaal zijn, maar is meestal erg specifiek: bijvoorbeeld voor het besturen van robots, voor controle van wasmachines of voor sturing van de on-board computer in auto’s. Mensen die deze machines maken zijn vaak geen programmeurs, en zij kunnen veel vlotter werken met een DSL dan met een algemene programmeertaal. diff --git a/content/posts/16-17/dink.md b/content/posts/16-17/dink.md deleted file mode 100644 index 72c2059..0000000 --- a/content/posts/16-17/dink.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: AWK-les -banner: https://upload.wikimedia.org/wikipedia/commons/6/61/Een.jpg -created_at: 23-10-2016 -time: 23-10-2016 -location: Auditorium A1, Campus Sterre, Gebouw S9 ---- - -Op **dinsdag 23 februari 18:00** (na de les Scriptingtalen) in **Auditorium A1** organiseren we een **AWK-les** gegeven door **professor Peter Dawyndt**. - -**AWK** is een scriptingtaal, bedoeld om lijn per lijn tekstbestanden te verwerken. Zo wordt AWK vaak gebruikt voor de ingebouwde werking met delimiters om CSV bestanden en dergelijke te verwerken. AWK staat tevens bekend om de talloze [one-liners](http://www.pement.org/awk/awk1line.txt) die in de command line gebruikt kunnen worden. - -Sinds vorig jaar wordt AWK (samen met sed) niet meer gegeven in het vak Scriptingtalen, om meer te kunnen concentreren op Python en JavaScript. Hoewel deze zeer goede general purpose talen zijn, blijft AWK ongeëvenaard voor razendsnelle tekstverwerking en transformaties. diff --git a/content/posts/16-17/review-awk.md b/content/posts/16-17/review-awk.md new file mode 100644 index 0000000..8e1e5bf --- /dev/null +++ b/content/posts/16-17/review-awk.md @@ -0,0 +1,7 @@ +--- +title: AWK review +description: We hebben even wat dingen in Awk geschreven, en dit zijn onze meningen +created_at: 23-10-2016 +--- + +Awk is een toffe taal enal diff --git a/layouts/blogpost.erb b/layouts/blogpost.erb new file mode 100644 index 0000000..9496929 --- /dev/null +++ b/layouts/blogpost.erb @@ -0,0 +1,8 @@ +
+

+ <%= item[:title] %> +

+
+ <%= yield %> +
+
diff --git a/layouts/partials/_navbar.erb b/layouts/partials/_navbar.erb index 86ac7d2..843efe6 100644 --- a/layouts/partials/_navbar.erb +++ b/layouts/partials/_navbar.erb @@ -1,36 +1,44 @@ - +
+
diff --git a/layouts/partials/_tile.erb b/layouts/partials/_tile.erb index f7a1688..94c7675 100644 --- a/layouts/partials/_tile.erb +++ b/layouts/partials/_tile.erb @@ -1,7 +1,12 @@ -
-
- -
+
+
+
+

+ <%= @article[:title] %> +

+ <%= @article[:description] %> +
+
diff --git a/lib/filters/autoprefixer.rb b/lib/filters/autoprefixer.rb index d2047a5..b96b310 100644 --- a/lib/filters/autoprefixer.rb +++ b/lib/filters/autoprefixer.rb @@ -1,9 +1,4 @@ -class AutoprefixerFilter < Nanoc::Filter - require 'autoprefixer-rails' - - identifier :autoprefixer - - def run(content, _params = {}) - AutoprefixerRails.process(content).css - end +require 'autoprefixer-rails' +Nanoc::Filter.define(:autoprefixer) do |content, _params| + AutoprefixerRails.process(content).css end diff --git a/lib/filters/ical_filter.rb b/lib/filters/ical_filter.rb index a5c8acc..608b90c 100644 --- a/lib/filters/ical_filter.rb +++ b/lib/filters/ical_filter.rb @@ -1,3 +1,5 @@ +# This doesn't use the new define syntax yet because item +# is not available there class IcalFilter < Nanoc::Filter identifier :ical diff --git a/lib/filters/strip_filter.rb b/lib/filters/strip_filter.rb index 6b03ce9..b2c7682 100644 --- a/lib/filters/strip_filter.rb +++ b/lib/filters/strip_filter.rb @@ -1,7 +1,3 @@ -class StripFilter < Nanoc::Filter - identifier :strip_html - - def run(content, _params = {}) - strip_html(content) - end +Nanoc::Filter.define(:strip_html) do |content, _params| + strip_html(content) end diff --git a/lib/helpers/ical.rb b/lib/helpers/ical.rb index 22a3b55..69004ef 100644 --- a/lib/helpers/ical.rb +++ b/lib/helpers/ical.rb @@ -2,15 +2,16 @@ module IcalHelper def event_calendar cal = Icalendar::Calendar.new - events = items.find_all('/posts/**/*').map { |i| event_for(i) } - events.each { |e| cal.add_event(e) } + items.find_all('/events/*/*.md').each do |i| + cal.add_event(event_for(i)) + end cal.to_ical end - def event_for(i) + def event_for(item) event = Icalendar::Event.new - event.dtstart = Date.parse(i[:time]) + event.dtstart = Date.parse(item[:time]) event.summary = 'A great event!' event