-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rules
executable file
·52 lines (44 loc) · 1.36 KB
/
Rules
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
#!/usr/bin/env ruby
# The index page needs compiled with erb
compile '/index.html' do
filter :erb
layout '/default.*'
filter :relativize_paths, type: :html
write '/index.html'
end
# HTML files get piped straight through as a folder with an index file.
compile '/**/*.html' do
layout '/default.*'
filter :relativize_paths, type: :html
write item.identifier.without_ext + '/index.html'
end
# This rule matches Markdown (.md) files, and uses the :kramdown filter.
compile '/**/*.md' do
filter :kramdown
layout '/post.*'
filter :relativize_paths, type: :html
write item.identifier.without_ext + '/index.html'
end
# Compiles Sass stylesheet, as well as an accompanying source map
%i[default sourcemap].each do |rep_name|
# Ignores Sass files starting with an underscore
ignore '/css/_*.sass'
compile '/css/stylesheet.sass', rep: rep_name do
path = @item.identifier.without_ext + '.css'
options = { syntax: :sass, style: :compact, css_path: path, sourcemap_path: path + '.map' } # rubocop:disable LineLength
case rep_name
when :default
filter :sass, options
write path
when :sourcemap
filter :sass_sourcemap, options
write path + '.map'
end
end
end
# Any other files get piped straight through
compile '/**/*' do
write item.identifier.to_s
end
# All layout pages get compiled with erb
layout '/**/*', :erb