loadsa werk

This commit is contained in:
Lorin Werthen 2016-08-23 20:21:02 +02:00
parent 0478c80027
commit bc5da5b81e
No known key found for this signature in database
GPG key ID: F11FFC921E0E08E0
17 changed files with 184 additions and 85 deletions

View file

@ -1,14 +1,16 @@
# zeus.ugent.be # zeus.ugent.be
[![Build Status](https://travis-ci.org/ZeusWPI/zeus.ugent.be.svg?branch=master)](https://travis-ci.org/ZeusWPI/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 ```bash
bundle install bundle install
npm install npm install
``` ```
## Developing ### Developing
```bash ```bash
bundle exec nanoc live bundle exec nanoc live
@ -16,7 +18,7 @@ bundle exec nanoc live
This will spawn a webserver, and automatically recompile the site This will spawn a webserver, and automatically recompile the site
when files get changed. when files get changed.
## Deploying ### Deploying
The latest builds on master get deployed automatically using [travis](https://travis-ci.org). The latest builds on master get deployed automatically using [travis](https://travis-ci.org).
@ -25,3 +27,53 @@ For manual deployment, run
```bash ```bash
bundle exec nanoc deploy --target public 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)

31
Rules
View file

@ -68,9 +68,9 @@ compile '/archives/*' do
end end
# #
# POSTS # EVENTS
# #
compile '/posts/**/*' do compile '/events/**/*' do
filter :kramdown filter :kramdown
layout '/eventpost.*' layout '/eventpost.*'
@ -80,15 +80,36 @@ compile '/posts/**/*' do
filter :relativize_paths, type: :html filter :relativize_paths, type: :html
end end
compile '/posts/**/*', rep: :text do compile '/events/**/*', rep: :text do
filter :kramdown filter :kramdown
filter :strip_html filter :strip_html
end end
compile '/posts/**/*', rep: :ical do compile '/events/**/main.md', rep: :ical do
end
compile '/events/**/*', rep: :ical do
filter :ical filter :ical
end 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 # GENERIC ERB PAGES
# #
@ -141,7 +162,7 @@ route '/assets/scripts/**/*' do
end end
# POSTS # POSTS
route '/posts/**/*', rep: :ical do route '/events/**/*', rep: :ical do
"#{item.identifier.without_ext}.ics" "#{item.identifier.without_ext}.ics"
end end

View file

@ -10,15 +10,27 @@ html, body {
} }
} }
#navbar { #navbar {
.nav-item { align-items: flex-end;
transition: 0.2s;
font-variant: small-caps; #logo-link {
font-size: 1.25em; #logo {
width: 100px;
&:hover { }
}
.nav {
height: 100%;
align-items: flex-end;
.nav-item {
transition: 0.2s; transition: 0.2s;
font-variant: small-caps;
font-size: 1.25em;
&:hover {
transition: 0.2s;
}
} }
} }
} }

View file

@ -0,0 +1,5 @@
---
title: Bottle Bats Introductie
time: 12-3-16
location: Grace Hopper
---

View file

@ -0,0 +1,3 @@
---
title: Bottle Bats
---

View file

@ -1,13 +1,13 @@
<div class="tile is-vertical is-ancestor"> <div class="tile is-vertical is-ancestor">
<div class="tile is-parent is-12"> <div class="tile is-parent is-12">
<div class="tile is-child box"> <div class="tile is-child">
<%= render '/partials/_tile.*', article: sorted_articles[0] %> <%= render '/partials/_tile.*', article: sorted_articles[0] %>
</div> </div>
</div> </div>
<div class="tile"> <div class="tile">
<% sorted_articles[1..-1].each do |article| %> <% sorted_articles[1..-1].each do |article| %>
<div class="tile is-parent is-4"> <div class="tile is-parent is-4">
<div class="tile is-child box"> <div class="tile is-child">
<%= render '/partials/_tile.*', article: article %> <%= render '/partials/_tile.*', article: article %>
</div> </div>
</div> </div>

View file

@ -1,9 +1,6 @@
--- ---
title: Xtext Workshop title: Xtext Workshop
banner: https://zeus.ugent.be/wp-content/uploads/2016/04/450px-Xtext_logo.png
created_at: 01-04-2016 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 autos. Mensen die deze machines maken zijn vaak geen programmeurs, en zij kunnen veel vlotter werken met een DSL dan met een algemene programmeertaal. 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 autos. Mensen die deze machines maken zijn vaak geen programmeurs, en zij kunnen veel vlotter werken met een DSL dan met een algemene programmeertaal.

View file

@ -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.

View file

@ -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

8
layouts/blogpost.erb Normal file
View file

@ -0,0 +1,8 @@
<div class="content">
<h1 class="has-text-centered">
<%= item[:title] %>
</h1>
<main>
<%= yield %>
</main>
</div>

View file

@ -1,36 +1,44 @@
<nav id="navbar" class="nav"> <div id="navbar">
<div class="nav-left"> <div class="columns">
<a class="nav-item" href="/"> <div class="column is-narrow">
<a id="logo-link" href="/">
<img id="logo" src="https://zeus.ugent.be/wp-content/uploads/2009/05/logo-new.png" alt="" /> <img id="logo" src="https://zeus.ugent.be/wp-content/uploads/2009/05/logo-new.png" alt="" />
</a> </a>
<% nav_items do |item, active| %>
<a class="nav-item is-tab <%= 'is-active' if active %>" href="<%= relative_path_to(item) %>">
<%= item[:title] %>
</a>
<% end %>
</div> </div>
<div class="column">
<nav class="nav">
<div class="nav-left">
<div class="nav-right"> <% nav_items do |item, active| %>
<a class="nav-item" href="https://github.com/ZeusWPI" target="_blank"> <a class="nav-item is-tab <%= 'is-active' if active %>" href="<%= relative_path_to(item) %>">
<span class="icon"> <%= item[:title] %>
<i class="fa fa-github"></i> </a>
</span> <% end %>
</a> </div>
<a class="nav-item" href="https://www.facebook.com/zeus.wpi/" target="_blank">
<span class="icon"> <div class="nav-right">
<i class="fa fa-facebook"></i> <a class="nav-item" href="https://github.com/ZeusWPI" target="_blank">
</span> <span class="icon">
</a> <i class="fa fa-github"></i>
<a class="nav-item" href="/feed.xml" target="_blank"> </span>
<span class="icon"> </a>
<i class="fa fa-rss"></i> <a class="nav-item" href="https://www.facebook.com/zeus.wpi/" target="_blank">
</span> <span class="icon">
</a> <i class="fa fa-facebook"></i>
<a class="nav-item" href="/ical.ics"> </span>
<span class="icon"> </a>
<i class="fa fa-calendar"></i> <a class="nav-item" href="/feed.xml" target="_blank">
</span> <span class="icon">
</a> <i class="fa fa-rss"></i>
</span>
</a>
<a class="nav-item" href="/ical.ics">
<span class="icon">
<i class="fa fa-calendar"></i>
</span>
</a>
</div>
</nav>
</div> </div>
</nav> </div>
</div>

View file

@ -1,7 +1,12 @@
<a href="<%= relative_path_to(@article) %>"> <a href="<%= relative_path_to(@article) %>">
<div class="event"> <div class="box">
<figure class="image"> <div class="event">
<img src='<%= @article[:banner] %>' alt="" /> <div class="content">
</figure> <h1>
<%= @article[:title] %>
</h1>
<%= @article[:description] %>
</div>
</div>
</div> </div>
</a> </a>

View file

@ -1,9 +1,4 @@
class AutoprefixerFilter < Nanoc::Filter require 'autoprefixer-rails'
require 'autoprefixer-rails' Nanoc::Filter.define(:autoprefixer) do |content, _params|
AutoprefixerRails.process(content).css
identifier :autoprefixer
def run(content, _params = {})
AutoprefixerRails.process(content).css
end
end end

View file

@ -1,3 +1,5 @@
# This doesn't use the new define syntax yet because item
# is not available there
class IcalFilter < Nanoc::Filter class IcalFilter < Nanoc::Filter
identifier :ical identifier :ical

View file

@ -1,7 +1,3 @@
class StripFilter < Nanoc::Filter Nanoc::Filter.define(:strip_html) do |content, _params|
identifier :strip_html strip_html(content)
def run(content, _params = {})
strip_html(content)
end
end end

View file

@ -2,15 +2,16 @@ module IcalHelper
def event_calendar def event_calendar
cal = Icalendar::Calendar.new cal = Icalendar::Calendar.new
events = items.find_all('/posts/**/*').map { |i| event_for(i) } items.find_all('/events/*/*.md').each do |i|
events.each { |e| cal.add_event(e) } cal.add_event(event_for(i))
end
cal.to_ical cal.to_ical
end end
def event_for(i) def event_for(item)
event = Icalendar::Event.new event = Icalendar::Event.new
event.dtstart = Date.parse(i[:time]) event.dtstart = Date.parse(item[:time])
event.summary = 'A great event!' event.summary = 'A great event!'
event event