Compare commits
3 commits
master
...
dsa-dataso
Author | SHA1 | Date | |
---|---|---|---|
c2d3c99022 | |||
e675b0d722 | |||
81e0912e83 |
3
.editorconfig
Normal file
|
@ -0,0 +1,3 @@
|
|||
[*.erb]
|
||||
indent_style = space
|
||||
indent_size = 2
|
5
.gitignore
vendored
|
@ -11,5 +11,6 @@ crash.log
|
|||
|
||||
.idea/
|
||||
|
||||
|
||||
.sass-cache/
|
||||
.bundle/
|
||||
vendor/
|
||||
.byebug_history
|
||||
|
|
2
Gemfile
|
@ -10,6 +10,8 @@ gem 'nanoc'
|
|||
gem 'pdfkit'
|
||||
gem 'sass'
|
||||
gem 'nokogiri'
|
||||
gem 'faraday'
|
||||
gem 'json'
|
||||
|
||||
group :nanoc do
|
||||
gem 'guard-nanoc'
|
||||
|
|
15
Gemfile.lock
|
@ -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
|
||||
|
|
11
Makefile
|
@ -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
|
||||
|
|
22
README.md
|
@ -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
|
@ -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
|
||||
|
||||
|
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
@ -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);
|
||||
}
|
||||
});
|
Before Width: | Height: | Size: 152 KiB |
Before Width: | Height: | Size: 164 KiB |
Before Width: | Height: | Size: 398 KiB |
Before Width: | Height: | Size: 980 KiB |
Before Width: | Height: | Size: 676 KiB |
Before Width: | Height: | Size: 874 KiB |
Before Width: | Height: | Size: 660 KiB |
Before Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 221 KiB |
Before Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 474 KiB |
Before Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 4.1 MiB |
Before Width: | Height: | Size: 727 KiB |
Before Width: | Height: | Size: 109 KiB |
Before Width: | Height: | Size: 121 KiB |
Before Width: | Height: | Size: 450 KiB |
Before Width: | Height: | Size: 376 KiB |
Before Width: | Height: | Size: 130 KiB |
Before Width: | Height: | Size: 4.2 MiB |
Before Width: | Height: | Size: 3.5 MiB |
Before Width: | Height: | Size: 4.3 MiB |
Before Width: | Height: | Size: 490 KiB |
Before Width: | Height: | Size: 428 KiB |
Before Width: | Height: | Size: 405 KiB |
Before Width: | Height: | Size: 657 KiB |
Before Width: | Height: | Size: 198 KiB |
Before Width: | Height: | Size: 108 KiB |
Before Width: | Height: | Size: 242 KiB |
Before Width: | Height: | Size: 461 KiB |
Before Width: | Height: | Size: 268 KiB |
Before Width: | Height: | Size: 2.5 MiB |
Before Width: | Height: | Size: 4.9 MiB |
Before Width: | Height: | Size: 7.5 MiB |
Before Width: | Height: | Size: 572 KiB |
Before Width: | Height: | Size: 536 KiB |
Before Width: | Height: | Size: 163 KiB |
Before Width: | Height: | Size: 375 KiB |
Before Width: | Height: | Size: 101 KiB |
Before Width: | Height: | Size: 4.9 MiB |
Before Width: | Height: | Size: 221 KiB |
Before Width: | Height: | Size: 892 KiB |
Before Width: | Height: | Size: 150 KiB |
Before Width: | Height: | Size: 422 KiB |
Before Width: | Height: | Size: 217 KiB |
Before Width: | Height: | Size: 94 KiB |
Before Width: | Height: | Size: 464 KiB |
Before Width: | Height: | Size: 120 KiB |
Before Width: | Height: | Size: 193 KiB |
Before Width: | Height: | Size: 323 KiB |
Before Width: | Height: | Size: 1.9 MiB |
Before Width: | Height: | Size: 2.4 MiB |
Before Width: | Height: | Size: 463 KiB |
Before Width: | Height: | Size: 296 KiB |
Before Width: | Height: | Size: 87 KiB |
Before Width: | Height: | Size: 328 KiB |
Before Width: | Height: | Size: 810 KiB |
Before Width: | Height: | Size: 565 KiB |
Before Width: | Height: | Size: 1.6 MiB |
Before Width: | Height: | Size: 4.8 MiB |
Before Width: | Height: | Size: 940 KiB |
Before Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 307 KiB |
Before Width: | Height: | Size: 500 KiB |
Before Width: | Height: | Size: 266 KiB |
Before Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 87 KiB |
Before Width: | Height: | Size: 108 KiB |
Before Width: | Height: | Size: 185 KiB |
Before Width: | Height: | Size: 186 KiB |
Before Width: | Height: | Size: 3.8 MiB |
Before Width: | Height: | Size: 2.7 MiB |
Before Width: | Height: | Size: 1.5 MiB |
Before Width: | Height: | Size: 692 KiB |
Before Width: | Height: | Size: 302 KiB |
Before Width: | Height: | Size: 294 KiB |
Before Width: | Height: | Size: 105 KiB |
Before Width: | Height: | Size: 105 KiB |
Before Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 1.6 MiB |
Before Width: | Height: | Size: 1.9 MiB |
Before Width: | Height: | Size: 4 MiB |
Before Width: | Height: | Size: 6.2 MiB |
Before Width: | Height: | Size: 5.6 MiB |
Before Width: | Height: | Size: 5.4 MiB |
Before Width: | Height: | Size: 15 MiB |
Before Width: | Height: | Size: 16 MiB |