Compare commits

..

3 commits

Author SHA1 Message Date
mcbloch c2d3c99022 Remove image loading, some other stuff 2020-08-29 20:40:19 +02:00
mcbloch e675b0d722 Merge branch 'master' into dsa-datasource 2020-08-29 17:18:07 +02:00
mcbloch 81e0912e83 Initial work on dsa external datasource 2020-08-29 17:17:46 +02:00
365 changed files with 775 additions and 3979 deletions

3
.editorconfig Normal file
View file

@ -0,0 +1,3 @@
[*.erb]
indent_style = space
indent_size = 2

5
.gitignore vendored
View file

@ -11,5 +11,6 @@ crash.log
.idea/
.sass-cache/
.bundle/
vendor/
.byebug_history

View file

@ -10,6 +10,8 @@ gem 'nanoc'
gem 'pdfkit'
gem 'sass'
gem 'nokogiri'
gem 'faraday'
gem 'json'
group :nanoc do
gem 'guard-nanoc'

View file

@ -24,6 +24,8 @@ GEM
equatable (0.6.1)
eventmachine (1.2.7)
execjs (2.7.0)
faraday (1.0.1)
multipart-post (>= 1.2, < 3)
ffi (1.13.1)
formatador (0.2.5)
guard (2.16.2)
@ -50,6 +52,7 @@ GEM
concurrent-ruby (~> 1.0)
htmlcompressor (0.4.0)
http_parser.rb (0.6.0)
json (2.3.1)
json_schema (0.20.9)
kramdown (2.3.0)
rexml
@ -63,6 +66,7 @@ GEM
mini_racer (0.3.1)
libv8 (~> 8.4.255)
multi_json (1.15.0)
multipart-post (2.1.1)
nanoc (4.11.18)
addressable (~> 2.5)
colored (~> 1.2)
@ -122,16 +126,9 @@ GEM
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sassc (2.4.0)
ffi (~> 1.9)
shellany (0.0.1)
slim (4.1.0)
temple (>= 0.7.6, < 0.9)
tilt (>= 2.0.6, < 2.1)
slow_enumerator_tools (1.1.0)
temple (0.8.2)
thor (1.0.1)
tilt (2.0.10)
tomlrb (1.3.0)
tty-color (0.5.2)
tty-command (0.9.0)
@ -147,17 +144,17 @@ DEPENDENCIES
adsf
autoprefixer-rails
byebug
faraday
guard-livereload
guard-nanoc
htmlcompressor
json
kramdown
mini_racer
nanoc
nokogiri
pdfkit
sass
sassc
slim
BUNDLED WITH
2.1.4

View file

@ -1,11 +1,2 @@
.PHONY: live build setup
live:
bundle exec nanoc live
build:
bundle exec 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
nanoc

View file

@ -3,24 +3,12 @@ Durf Doen 2.0
## Setup instructions
1. Install Ruby, preferably the version specified in `.ruby-version`
2. Install bundler (`gem install bundler`)
3. Install other dependencies (`bundle install`)
4. Build and serve the site (`bundle exec nanoc live`)
1. Install bundler (`gem install bundler`)
2. Install other gems (`bundle install`)
3. Build and serve the site (`bundle exec nanoc live`)
To build the artefacts for production: `bundle exec nanoc`
### Optional setup via docker
### 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.
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

45
Rules
View file

@ -6,8 +6,9 @@ preprocess do
themas.each do |thema|
content = ''
attributes = {
identifier: thema,
naam: thema.downcase
naam: thema,
verenigingen: @items.filter { |i| i[:themas] and i[:themas].include?(thema) }.flatten.uniq.compact,
image: '/assets/placeholder.png'
}
identifier = "/themas/#{thema}"
@ -15,9 +16,28 @@ preprocess do
end
end
compile '/{verenigingen,projecten,konventen}/*.md' do
# Don't just render items from external sources
ignore '/external/**/*'
compile '/{verenigingen,projecten}/*.md' do
filter :kramdown
layout '/detail.*'
layout '/vereniging.*'
layout '/default.*'
layout '/base.*'
write ext: 'html'
end
compile '/evenementen/*.md' do
filter :kramdown
layout '/evenement.*'
layout '/default.*'
layout '/base.*'
write ext: 'html'
end
compile '/konventen/*.md' do
filter :kramdown
layout '/konvent.*'
layout '/default.*'
layout '/base.*'
write ext: 'html'
@ -33,7 +53,6 @@ end
compile '/homepage.md' do
filter :kramdown
layout '/homepage.*'
layout '/default.*'
layout '/base.*'
write '/index.html'
end
@ -50,21 +69,6 @@ compile '/verenigingen.md' do
write '/verenigingen/index.html'
end
compile '/quiz.md' do
filter :kramdown
layout '/quiz.*'
layout '/default.*'
layout '/base.*'
write '/quiz/index.html'
end
compile '/search.html.erb' do
filter :erb
layout '/default.*'
layout '/base.*'
write ext: 'html'
end
compile '/*.md' do
filter :kramdown
layout '/default.*'
@ -91,3 +95,4 @@ layout '/**/*', :erb
compile '/**/*' do
write item.identifier.to_s
end

View file

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 MiB

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