This repository was archived by the owner on Jul 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRules
More file actions
77 lines (59 loc) · 1.42 KB
/
Rules
File metadata and controls
77 lines (59 loc) · 1.42 KB
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
#!/usr/bin/env ruby
# A few helpful tips about the Rules file:
#
# * The order of rules is important: for each item, only the first matching
# rule is applied.
#
# * Item identifiers start and end with a slash (e.g. "/about/" for the file
# "content/about.html"). To select all children, grandchildren, ... of an
# item, use the pattern "/about/*/"; "/about/*" will also select the parent,
# because "*" matches zero or more characters.
# CONFIG
static_files_regexp = %r{^/(assets|images|css|js|javascript)/}
# PREPROCESS
# preprocess do
# end
# COMPILATION
compile '/assets/css/*' do
filter :sass
rep.filter :relativize_paths, :type => :css
end
compile static_files_regexp do
# Static content
end
compile '*' do
# Filter depending on extension
case item[:extension]
when 'erb'
filter :erb
else
filter :haml
end
# filter :haml
layout 'default'
end
# ROUTING
route '/**/_*' do
# Don't render partials
nil
end
route '/assets/css/*' do
# CSS
item.identifier.chop + '.css'
end
route '/' do
# Root index file
item.identifier + 'index.html'
end
route static_files_regexp do
# Static content
item.identifier[0..-2] + '.' + item[:extension]
end
route '*' do
# # Folder/index.html
# item.identifier + 'index.html'
# Page.html
item.identifier[0..-2] + '.html'
end
# LAYOUTING
layout '*', :haml