forked from michelson/Dante
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.rb
86 lines (54 loc) · 2.28 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
class DistBuilder < Middleman::Extension
def initialize(app, options_hash={}, &block)
super
app.after_build do |builder|
app.config[:dist_dir] = "dist"
FileUtils.rm_rf Dir.glob("#{app.config[:dist_dir]}/*")
base_dist_path = app.config[:dist_dir]
dist_fonts_path = File.join(base_dist_path, "fonts", "dante")
dist_images_path = File.join(base_dist_path, "images", "dante")
dist_js_path = File.join(base_dist_path, "js")
dist_css_path = File.join(base_dist_path, "css")
#FileUtils.rm_rf base_dist_path
builder.say_status :dist_builder, "generating dist files"
fonts_dir = File.join(app.config[:build_dir], app.config[:fonts_dir])
FileUtils.mkdir_p dist_fonts_path
FileUtils.cp_r "#{fonts_dir}/dante/.", dist_fonts_path, :verbose => true
images_dir = File.join(app.config[:build_dir], app.config[:images_dir])
FileUtils.mkdir_p dist_images_path
FileUtils.cp_r "#{images_dir}/dante/.", dist_images_path, :verbose => true
js_dir = File.join(app.config[:build_dir], app.config[:js_dir])
FileUtils.mkdir_p dist_js_path
FileUtils.cp "#{js_dir}/dante-editor.js", dist_js_path, :verbose => true
css_dir = File.join(app.config[:build_dir], app.config[:css_dir])
FileUtils.mkdir_p dist_css_path
FileUtils.cp "#{css_dir}/dante-editor.css", dist_css_path, :verbose => true
builder.say_status :dist_builder, "dist complete"
end
end
end
::Middleman::Extensions.register(:dist_builder, DistBuilder)
set :css_dir, 'assets/stylesheets'
set :js_dir, 'assets/javascripts'
set :images_dir, 'assets/images'
set :fonts_dir, 'assets/fonts'
#set :markdown_engine, :redcarpet
set :markdown_engine, :kramdown
page "/tests/*", :layout => "spec"
sprockets.append_path File.join "#{root}", "bower_components"
# Build-specific configuration
configure :build do
# For example, change the Compass output style for deployment
# activate :minify_css
# Minify Javascript on build
# activate :minify_javascript
# Enable cache buster
# activate :asset_hash
activate :relative_assets
set :relative_links, true
activate :dist_builder
# Use relative URLs
# activate :relative_assets
# Or use a different image path
# set :http_path, "/Content/images/"
end