File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 9
9
# “content/about.html”). To select all children, grandchildren, … of an
10
10
# item, use the pattern “/about/*/”; “/about/*” will also select the parent,
11
11
# because “*” matches zero or more characters.
12
+ #
13
+ # routes define what file should be served for a certain request
14
+ #
15
+ # compiles define how the content for a given route should be prepared
12
16
13
17
route '/assets/*/' do
18
+ # when the request is for /assets/*
19
+ # (e.g. '/assets/css/style.css') ...
20
+ # this is the file to return, so we
21
+ # return the item's identifier (e.g. '/assets/css/style/')
22
+ # but chop off its last character ('/assets/css/style')
23
+ # and then append the item's extension ('css')
14
24
item . identifier . chop + '.' + item [ :extension ]
15
25
end
16
26
17
- # compile is what to do with the source files
18
27
compile '/assets/*/' do
28
+ # for assets, we don't want to do anything
19
29
nil
20
30
end
21
31
32
+ # these rules only apply if none of the rules above apply
33
+
22
34
compile '*' do
35
+ # for most things, we want to run them through kramdown
23
36
filter :kramdown
24
37
layout 'default'
25
38
end
26
39
27
40
route '*' do
41
+ # for most things, we want to return the index.html
42
+ # that corresponds with the identifier
28
43
item . identifier + 'index.html'
29
44
end
30
45
You can’t perform that action at this time.
0 commit comments