Compare commits

..

3 commits
master ... Quiz

Author SHA1 Message Date
nvdghins
60b9aa2b6e vraag tot aanpassing engage 2020-09-13 13:38:42 +02:00
ajuvercr
8fc305ccc5 fix quiz indentation 2020-09-13 11:04:01 +02:00
nvdghins
2f4c2e3b16 interesses groeperen en politiek aanpassen 2020-09-13 00:59:14 +02:00
399 changed files with 1156 additions and 4598 deletions

3
.gitignore vendored
View file

@ -10,6 +10,3 @@ tmp/nanoc/
crash.log crash.log
.idea/ .idea/
.sass-cache/

View file

@ -1 +1 @@
2.7.1 2.7.0

View file

@ -1,32 +0,0 @@
# ------- Build -------
FROM ruby:2.7.1-alpine3.11 AS build
RUN apk add build-base
RUN mkdir -p /app
WORKDIR /app
COPY Gemfile .
COPY Gemfile.lock .
RUN bundle config set deployment 'true'
RUN bundle config set without 'development'
RUN bundle install
COPY content content/
COPY layouts layouts/
COPY lib lib/
COPY Guardfile .
COPY Rules .
COPY nanoc.yaml .
RUN bundle exec nanoc
# ------- Release -------
FROM nginx:latest AS release
RUN rm -rf /usr/share/nginx/html/*
COPY --from=build /app/output /usr/share/nginx/html
ENTRYPOINT ["nginx", "-g", "daemon off;"]

View file

@ -3,19 +3,18 @@ source 'https://rubygems.org'
gem 'adsf' gem 'adsf'
gem 'autoprefixer-rails' gem 'autoprefixer-rails'
gem 'byebug'
gem 'htmlcompressor' gem 'htmlcompressor'
gem 'kramdown' gem 'kramdown'
gem 'mini_racer' gem 'mini_racer'
gem 'nanoc' gem 'nanoc'
gem 'pdfkit' gem 'pdfkit'
gem 'sass' gem 'sass'
gem 'nokogiri' gem 'sassc'
gem 'slim'
gem 'sass'
group :nanoc do group :nanoc do
gem 'guard-nanoc' gem 'guard-nanoc'
gem 'guard-livereload' gem 'guard-livereload'
end end
group :development do
gem 'byebug'
end

View file

@ -5,28 +5,28 @@ GEM
public_suffix (>= 2.0.2, < 5.0) public_suffix (>= 2.0.2, < 5.0)
adsf (1.4.3) adsf (1.4.3)
rack (>= 1.0.0, < 3.0.0) rack (>= 1.0.0, < 3.0.0)
autoprefixer-rails (9.8.6.3) autoprefixer-rails (9.7.4)
execjs execjs
byebug (11.1.3) byebug (11.1.1)
coderay (1.1.3) coderay (1.1.2)
colored (1.2) colored (1.2)
concurrent-ruby (1.1.7) concurrent-ruby (1.1.6)
cri (2.15.10) cri (2.15.10)
ddmemoize (1.0.0) ddmemoize (1.0.0)
ddmetrics (~> 1.0) ddmetrics (~> 1.0)
ref (~> 2.0) ref (~> 2.0)
ddmetrics (1.0.1) ddmetrics (1.0.1)
ddplugin (1.0.2) ddplugin (1.0.2)
diff-lcs (1.4.4) diff-lcs (1.3)
em-websocket (0.5.1) em-websocket (0.5.1)
eventmachine (>= 0.12.9) eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0) http_parser.rb (~> 0.6.0)
equatable (0.6.1) equatable (0.6.1)
eventmachine (1.2.7) eventmachine (1.2.7)
execjs (2.7.0) execjs (2.7.0)
ffi (1.13.1) ffi (1.12.2)
formatador (0.2.5) formatador (0.2.5)
guard (2.16.2) guard (2.16.1)
formatador (>= 0.2.4) formatador (>= 0.2.4)
listen (>= 2.7, < 4.0) listen (>= 2.7, < 4.0)
lumberjack (>= 1.0.12, < 2.0) lumberjack (>= 1.0.12, < 2.0)
@ -41,48 +41,39 @@ GEM
guard (~> 2.8) guard (~> 2.8)
guard-compat (~> 1.0) guard-compat (~> 1.0)
multi_json (~> 1.8) multi_json (~> 1.8)
guard-nanoc (2.1.9) guard-nanoc (2.1.7)
guard (~> 2.8) guard (~> 2.8)
guard-compat (~> 1.0) guard-compat (~> 1.0)
nanoc-cli (~> 4.11, >= 4.11.14) nanoc (>= 4.11.13, < 5.0)
nanoc-core (~> 4.11, >= 4.11.14)
hamster (3.0.0) hamster (3.0.0)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
htmlcompressor (0.4.0) htmlcompressor (0.4.0)
http_parser.rb (0.6.0) http_parser.rb (0.6.0)
json_schema (0.20.9) json_schema (0.20.8)
kramdown (2.3.0) kramdown (2.1.0)
rexml libv8 (7.3.492.27.1)
libv8 (8.4.255.0)
listen (3.2.1) listen (3.2.1)
rb-fsevent (~> 0.10, >= 0.10.3) rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10) rb-inotify (~> 0.9, >= 0.9.10)
lumberjack (1.2.7) lumberjack (1.2.4)
method_source (1.0.0) method_source (0.9.2)
mini_portile2 (2.4.0) mini_racer (0.2.9)
mini_racer (0.3.1) libv8 (>= 6.9.411)
libv8 (~> 8.4.255) multi_json (1.14.1)
multi_json (1.15.0) nanoc (4.11.14)
nanoc (4.11.18)
addressable (~> 2.5) addressable (~> 2.5)
colored (~> 1.2) colored (~> 1.2)
nanoc-checking (~> 1.0) nanoc-cli (= 4.11.14)
nanoc-cli (= 4.11.18) nanoc-core (= 4.11.14)
nanoc-core (= 4.11.18)
nanoc-deploying (~> 1.0)
parallel (~> 1.12) parallel (~> 1.12)
tty-command (~> 0.8) tty-command (~> 0.8)
tty-which (~> 0.4) tty-which (~> 0.4)
nanoc-checking (1.0.0) nanoc-cli (4.11.14)
nanoc-cli (~> 4.11, >= 4.11.15)
nanoc-core (~> 4.11, >= 4.11.15)
nanoc-cli (4.11.18)
cri (~> 2.15) cri (~> 2.15)
diff-lcs (~> 1.3) diff-lcs (~> 1.3)
nanoc-core (= 4.11.18) nanoc-core (= 4.11.14)
zeitwerk (~> 2.1) zeitwerk (~> 2.1)
nanoc-core (4.11.18) nanoc-core (4.11.14)
concurrent-ruby (~> 1.1)
ddmemoize (~> 1.0) ddmemoize (~> 1.0)
ddmetrics (~> 1.0) ddmetrics (~> 1.0)
ddplugin (~> 1.0) ddplugin (~> 1.0)
@ -92,53 +83,46 @@ GEM
tomlrb (~> 1.2) tomlrb (~> 1.2)
tty-platform (~> 0.2) tty-platform (~> 0.2)
zeitwerk (~> 2.1) zeitwerk (~> 2.1)
nanoc-deploying (1.0.0)
nanoc-checking (~> 1.0)
nanoc-cli (~> 4.11, >= 4.11.15)
nanoc-core (~> 4.11, >= 4.11.15)
nenv (0.3.0) nenv (0.3.0)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
notiffany (0.1.3) notiffany (0.1.3)
nenv (~> 0.1) nenv (~> 0.1)
shellany (~> 0.0) shellany (~> 0.0)
parallel (1.19.2) parallel (1.19.1)
pastel (0.7.4) pastel (0.7.3)
equatable (~> 0.6) equatable (~> 0.6)
tty-color (~> 0.5) tty-color (~> 0.5)
pdfkit (0.8.4.3.2) pdfkit (0.8.4.1)
pry (0.13.1) pry (0.12.2)
coderay (~> 1.1) coderay (~> 1.1.0)
method_source (~> 1.0) method_source (~> 0.9.0)
public_suffix (4.0.5) public_suffix (4.0.3)
rack (2.2.3) rack (2.2.2)
rb-fsevent (0.10.4) rb-fsevent (0.10.3)
rb-inotify (0.10.1) rb-inotify (0.10.1)
ffi (~> 1.0) ffi (~> 1.0)
ref (2.0.0) ref (2.0.0)
rexml (3.2.4)
sass (3.7.4) sass (3.7.4)
sass-listen (~> 4.0.0) sass-listen (~> 4.0.0)
sass-listen (4.0.0) sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4) rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7) rb-inotify (~> 0.9, >= 0.9.7)
sassc (2.4.0) sassc (2.2.1)
ffi (~> 1.9) ffi (~> 1.9)
shellany (0.0.1) shellany (0.0.1)
slim (4.1.0) slim (4.0.1)
temple (>= 0.7.6, < 0.9) temple (>= 0.7.6, < 0.9)
tilt (>= 2.0.6, < 2.1) tilt (>= 2.0.6, < 2.1)
slow_enumerator_tools (1.1.0) slow_enumerator_tools (1.1.0)
temple (0.8.2) temple (0.8.2)
thor (1.0.1) thor (1.0.1)
tilt (2.0.10) tilt (2.0.10)
tomlrb (1.3.0) tomlrb (1.2.9)
tty-color (0.5.2) tty-color (0.5.1)
tty-command (0.9.0) tty-command (0.9.0)
pastel (~> 0.7.0) pastel (~> 0.7.0)
tty-platform (0.3.0) tty-platform (0.3.0)
tty-which (0.4.2) tty-which (0.4.2)
zeitwerk (2.4.0) zeitwerk (2.2.2)
PLATFORMS PLATFORMS
ruby ruby
@ -153,7 +137,6 @@ DEPENDENCIES
kramdown kramdown
mini_racer mini_racer
nanoc nanoc
nokogiri
pdfkit pdfkit
sass sass
sassc sassc

View file

@ -1,11 +1,2 @@
.PHONY: live build setup
live:
bundle exec nanoc live
build: build:
bundle exec nanoc nanoc
setup:
which bundle || { { gem install bundler && which bundle; } || echo 'Could not find `bundle`.'" Make sure the directory with the Ruby's gem executables is in your PATH. (Typically ~/.gem/ruby/*/bin)" && false; }
bundle install

View file

@ -3,24 +3,6 @@ Durf Doen 2.0
## Setup instructions ## Setup instructions
1. Install Ruby, preferably the version specified in `.ruby-version` 1. Install bundler (`gem install bundler`)
2. Install bundler (`gem install bundler`) 2. Install other gems (`bundle install`)
3. Install other dependencies (`bundle install`) 3. Build and serve the site (`bundle exec nanoc live`)
4. Build and serve the site (`bundle exec nanoc live`)
To build the artefacts for production: `bundle exec nanoc`
### Setup on windows
This is very flaky, but it might help to
- Of course only install Ruby 2.6
- Change `gem 'mini_racer'` to `gem 'mini_racer', platforms: :ruby` in Gemfile
- Follow this GitHub page https://github.com/eakmotion/therubyracer_for_windows
- Edit this file `C:\Ruby26-x64\lib\ruby\gems\2.6.0\gems\eventmachine-1.2.7-x64-mingw32\lib`, adding `require 'em pure_ruby'` and a newline to the top of the file
- After all this, on my machine, it still throws an exception, but the live reloading works, until it doesn't (most of the time after a failed compile)
### Optional setup via Docker
You can run the code in a separated Docker environment. It compiles the code and serves the files via nginx.
docker build --tag durfdoen2 . && docker run --publish 8080:80 --detach --name dd durfdoen2

57
Rules
View file

@ -1,32 +1,23 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
preprocess do compile '/verenigingen/*.md' do
# Fetch a list of theme names from all items and construct items from them
themas = @items.map { |i| i[:themas] }.flatten.uniq.compact
themas.each do |thema|
content = ''
attributes = {
identifier: thema,
naam: thema.downcase
}
identifier = "/themas/#{thema}"
@items.create(content, attributes, identifier)
end
end
compile '/{verenigingen,projecten,konventen}/*.md' do
filter :kramdown filter :kramdown
layout '/detail.*' layout '/vereniging.*'
layout '/default.*' layout '/default.*'
layout '/base.*'
write ext: 'html' write ext: 'html'
end end
compile '/themas/*' do compile '/events/*.md' do
layout '/thema.*' filter :kramdown
layout '/event.*'
layout '/default.*'
write ext: 'html'
end
compile '/konventen/*.md' do
filter :kramdown
layout '/konvent.*'
layout '/default.*' layout '/default.*'
layout '/base.*'
write ext: 'html' write ext: 'html'
end end
@ -34,7 +25,6 @@ compile '/homepage.md' do
filter :kramdown filter :kramdown
layout '/homepage.*' layout '/homepage.*'
layout '/default.*' layout '/default.*'
layout '/base.*'
write '/index.html' write '/index.html'
end end
@ -42,33 +32,29 @@ compile '/faq/*' do
filter :kramdown filter :kramdown
end end
compile '/faq.erb' do
filter :erb
layout '/default.*'
write '/faq/index.html'
end
compile '/verenigingen.md' do compile '/verenigingen.md' do
filter :kramdown filter :kramdown
layout '/verenigingen.*' layout '/verenigingen.*'
layout '/default.*' layout '/default.*'
layout '/base.*' write ext: 'html'
write '/verenigingen/index.html'
end end
compile '/quiz.md' do compile '/quiz.md' do
filter :kramdown filter :kramdown
layout '/quiz.*' layout '/quiz.*'
layout '/default.*' layout '/default.*'
layout '/base.*'
write '/quiz/index.html'
end
compile '/search.html.erb' do
filter :erb
layout '/default.*'
layout '/base.*'
write ext: 'html' write ext: 'html'
end end
compile '/*.md' do compile '/*.md' do
filter :kramdown filter :kramdown
layout '/default.*' layout '/default.*'
layout '/base.*'
write ext: 'html' write ext: 'html'
end end
@ -80,9 +66,7 @@ end
compile '/*.erb' do compile '/*.erb' do
filter :erb filter :erb
layout '/default.*' write item.identifier.without_ext
layout '/base.*'
write item.identifier.without_ext + '/index.html'
end end
layout '/**/*', :erb layout '/**/*', :erb
@ -91,3 +75,4 @@ layout '/**/*', :erb
compile '/**/*' do compile '/**/*' do
write item.identifier.to_s write item.identifier.to_s
end end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View file

@ -1,16 +0,0 @@
window.addEventListener('load', function() {
let options = document.getElementsByClassName('randomVerenigingWrapper');
let selected = Array.from(options).map(x => ({ x, r: Math.random() + -0.5 * x.hasAttribute('data-iszeus')}))
.sort((a, b) => a.r - b.r)
.map(a => a.x)
.slice(0, 3)
.map(x => ({ x, r: Math.random()}))
.sort((a, b) => a.r - b.r)
.map(a => a.x);
let destination = document.getElementById("display_repo");
for (node of selected) {
node.getElementsByTagName("img")[0].setAttribute("loading", "eager");
destination.prepend(node);
}
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 398 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 980 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 676 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 874 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 660 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 474 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 727 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 450 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 376 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 490 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 657 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 461 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 536 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 892 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 422 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 323 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 810 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 940 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 692 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 MiB

Some files were not shown because too many files have changed in this diff Show more