Mercurial > piecrust2
comparison 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 |
comparison
equal
deleted
inserted
replaced
239:f43f19975671 | 240:c1d4e86a3918 |
---|---|
54 | 54 |
55 def _doProcess(self, in_path, out_path): | 55 def _doProcess(self, in_path, out_path): |
56 self._ensureInitialized() | 56 self._ensureInitialized() |
57 | 57 |
58 map_path = self._getMapPath(in_path) | 58 map_path = self._getMapPath(in_path) |
59 map_path = os.path.relpath(map_path) | 59 map_url = '/' + os.path.relpath(map_path, self.app.root_dir) |
60 args = [self._conf['bin'], '--source-map=%s' % map_path] | 60 args = [self._conf['bin'], |
61 '--source-map=%s' % map_path, | |
62 '--source-map-url=%s' % map_url] | |
61 args += self._conf['options'] | 63 args += self._conf['options'] |
62 args.append(in_path) | 64 args.append(in_path) |
63 args.append(out_path) | 65 args.append(out_path) |
64 logger.debug("Processing LESS file: %s" % args) | 66 logger.debug("Processing LESS file: %s" % args) |
65 | 67 |