def mapper(): mapper = RouteMapper() mapper.add( 'stylesheet', '/stylesheets/stylesheet.css', controller='staticsauce.modules.cssminify.controllers.stylesheet' ) return mapper
def mapper(): mapper = RouteMapper() mapper.add( 'index', '/index.html', 'staticsauce.controllers.simple.direct_to_file', template='/index.html' ) return mapper
def mapper(): mapper = RouteMapper() albums = models.albums() photo_permutations = [ {'album_slug': album.slug, 'slug': photo.slug} for album in albums for photo in album.photos ] mapper.add( 'albums', '/albums.html', controller='staticsauce.modules.gallery.controllers.albums' ) mapper.add( 'album', '/albums/{slug}.html', controller='staticsauce.modules.gallery.controllers.album', permutations=[{'slug': album.slug} for album in albums] ) mapper.add( 'photo', '/albums/{album_slug}/{slug}.html', controller='staticsauce.modules.gallery.controllers.photo', permutations=photo_permutations ) mapper.add( 'image', '/images/gallery/{album_slug}/{slug}.jpeg', controller='staticsauce.modules.gallery.controllers.image', permutations=photo_permutations ) mapper.add( 'thumbnail', '/images/gallery/{album_slug}/thumbnails/{slug}.jpeg', controller='staticsauce.modules.gallery.controllers.image', permutations=photo_permutations, kwargs={'thumbnail': True} ) mapper.add( 'album-feed', '/feeds/gallery/albums.xml', controller='staticsauce.modules.gallery.controllers.feed', ) return mapper