diff piecrust/processing/less.py @ 240:c1d4e86a3918

less: Generate a proper, available URL for the LESS CSS map file. * The `less` processor now generates a usable URL for map files. * The server can serve files from inside the `_cache` directory.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 15 Feb 2015 23:29:51 -0800
parents f82262f59600
children c4b3a7fd2f87
line wrap: on
line diff
--- a/piecrust/processing/less.py	Sun Feb 15 22:48:42 2015 -0800
+++ b/piecrust/processing/less.py	Sun Feb 15 23:29:51 2015 -0800
@@ -56,8 +56,10 @@
         self._ensureInitialized()
 
         map_path = self._getMapPath(in_path)
-        map_path = os.path.relpath(map_path)
-        args = [self._conf['bin'], '--source-map=%s' % map_path]
+        map_url = '/' + os.path.relpath(map_path, self.app.root_dir)
+        args = [self._conf['bin'],
+                '--source-map=%s' % map_path,
+                '--source-map-url=%s' % map_url]
         args += self._conf['options']
         args.append(in_path)
         args.append(out_path)