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
[![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)

31
Rules
View file

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

View file

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

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-parent is-12">
<div class="tile is-child box">
<div class="tile is-child">
<%= render '/partials/_tile.*', article: sorted_articles[0] %>
</div>
</div>
<div class="tile">
<% sorted_articles[1..-1].each do |article| %>
<div class="tile is-parent is-4">
<div class="tile is-child box">
<div class="tile is-child">
<%= render '/partials/_tile.*', article: article %>
</div>
</div>

View file

@ -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 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 class="nav-left">
<a class="nav-item" href="/">
<div id="navbar">
<div class="columns">
<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="" />
</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 class="column">
<nav class="nav">
<div class="nav-left">
<div class="nav-right">
<a class="nav-item" href="https://github.com/ZeusWPI" target="_blank">
<span class="icon">
<i class="fa fa-github"></i>
</span>
</a>
<a class="nav-item" href="https://www.facebook.com/zeus.wpi/" target="_blank">
<span class="icon">
<i class="fa fa-facebook"></i>
</span>
</a>
<a class="nav-item" href="/feed.xml" target="_blank">
<span class="icon">
<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>
<% 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 class="nav-right">
<a class="nav-item" href="https://github.com/ZeusWPI" target="_blank">
<span class="icon">
<i class="fa fa-github"></i>
</span>
</a>
<a class="nav-item" href="https://www.facebook.com/zeus.wpi/" target="_blank">
<span class="icon">
<i class="fa fa-facebook"></i>
</span>
</a>
<a class="nav-item" href="/feed.xml" target="_blank">
<span class="icon">
<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>
</nav>
</div>
</div>

View file

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

View file

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

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
identifier :ical

View file

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

View file

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