-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathconfig.rb
54 lines (45 loc) · 1.26 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
51
52
53
54
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 image_tag_2x(source, options = {})
source_2x = source.dup.insert(source.rindex('.'), '@2x')
options[:srcset] = "#{image_path(source_2x)} 2x"
image_tag source, options
end
def ruby_shops
csv_data = File.read("data/rubyshops/bnlrubyshops.csv")
hash = CSV.new(csv_data, headers: true, header_converters: :symbol)
hash.to_a(&:to_hash).sort_by { |hsh| hsh[:city] }
end
end
# Sitemap implementation
set :url_root, 'rubybelgium.be'
activate :search_engine_sitemap
activate :directory_indexes
activate :sprockets do |c|
c.expose_middleman_helpers = true
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 :asset_hash
end
configure :development do
activate :livereload
end