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
20 compile '/googleb33734e827953d88/' do
25 # don’t filter binary items
26 filter :svg2png if item[:extension] == 'svg'
33 route '/stylesheet/' do
37 route '/googleb33734e827953d88/' do
38 '/googleb33734e827953d88.html'
43 # Write item with identifier /foo/ to /foo.ext
44 if item[:extension] == 'svg'
45 # SVGs are transcoded by :svg2png filter
46 item.identifier.chop + '.png'
48 item.identifier.chop + '.' + item[:extension]
51 # Write item with identifier /foo/ to /foo/index.html
52 item.identifier + 'index.html'