forked from brug-be/rubybelgium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.rb
50 lines (42 loc) · 1.16 KB
/
config.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
require 'open-uri'
helpers do
def link_to_if(condition, name, options = {}, html_options = {}, &block)
if condition
link_to(name, options, html_options)
else
if block_given?
block.arity <= 1 ? capture(name, &block) : capture(name, options, html_options, &block)
else
ERB::Util.html_escape(name)
end
end
end
def csv_data
csv_data = open("https://raw.githubusercontent.com/brug-be/rubyshops/master/bnlrubyshops.csv").read
hash = CSV.new(csv_data, headers: true, header_converters: :symbol)
return hash.to_a.map { |row| row.to_hash }
end
end
set :relative_links, true
set :css_dir, 'assets/stylesheets'
set :images_dir, 'assets/images'
set :js_dir, 'assets/javascripts'
configure :build do
activate :minify_css
activate :minify_javascript
activate :minify_html
activate :gzip
activate :imageoptim
activate :asset_hash
activate :relative_assets
require_relative "./lib/build_cleaner"
activate :build_cleaner
end
activate :google_analytics do |ga|
ga.tracking_id = 'UA-76403519-1'
ga.development = false
end
# middleman-deploy
activate :deploy do |deploy|
deploy.method = :git
end