3 # A few helpful tips about the Rules file:
5 # * The string given to #compile and #route are matching patterns for
6 # identifiers--not for paths. Therefore, you can’t match on extension.
8 # * The order of rules is important: for each item, only the first matching
11 # * Item identifiers start and end with a slash (e.g. “/about/” for the file
12 # “content/about.html”). To select all children, grandchildren, … of an
13 # item, use the pattern “/about/*/”; “/about/*” will also select the parent,
14 # because “*” matches zero or more characters.
16 compile '/stylesheet/' do
17 # don’t filter or layout
22 # don’t filter binary items
23 filter :svg2png if item[:extension] == 'svg'
30 route '/stylesheet/' do
36 # Write item with identifier /foo/ to /foo.ext
37 if item[:extension] == 'svg'
38 # SVGs are transcoded by :svg2png filter
39 item.identifier.chop + '.png'
41 item.identifier.chop + '.' + item[:extension]
44 # Write item with identifier /foo/ to /foo/index.html
45 item.identifier + 'index.html'