forked from manchester-tech-events/techevents-nw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
site.rb
73 lines (59 loc) · 1.16 KB
/
site.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
require 'bundler/setup'
require 'json'
require 'sinatra'
require 'sass'
require 'erb'
require 'sinatra/assetpack'
require 'tilt/erb'
class App < Sinatra::Application
def initialize(app=nil)
super(app)
end
register Sinatra::AssetPack
assets do
js :application, [
'js/*.js'
]
css :application, [
'css/*.css'
]
js_compression :jsmin
css_compression :sass
end
# 404 Error!
not_found do
status 404
erb :not_found, :layout => :layout
end
error do
erb :error, :layout => :layout
end
get '/' do
redirect '/calendar'
end
get '/calendar' do
erb :calendar, :layout => :layout
end
get '/elsewhere' do
erb :elsewhere, :layout => :layout
end
get '/slack' do
erb :slack, :layout => :layout
end
get '/about' do
erb :about, :layout => :layout
end
get '/speakers' do
erb :speakers, :layout => :layout
end
get '/groups' do
json = File.read('data/groups.json')
events = JSON.parse(json)
erb :event_list, :layout => :layout, :locals => {events:events}
end
get '/conferences' do
json = File.read('data/conferences.json')
events = JSON.parse(json)
erb :event_list, :layout => :layout, :locals => {events:events}
end
end