Mercurial > piecrust2
comparison piecrust/processing/sass.py @ 1065:e00ff3dcb5ec
sass: Make sure `load_paths` are relative to the website's root.
| author | Ludovic Chabant <ludovic@chabant.com> |
|---|---|
| date | Tue, 13 Feb 2018 21:51:32 -0800 |
| parents | 4850f8c21b6e |
| children | a3dec0fbd9ce |
comparison
equal
deleted
inserted
replaced
| 1064:e1e459438f3f | 1065:e00ff3dcb5ec |
|---|---|
| 124 self._conf.setdefault('options', []) | 124 self._conf.setdefault('options', []) |
| 125 if not isinstance(self._conf['options'], list): | 125 if not isinstance(self._conf['options'], list): |
| 126 raise Exception("The `sass/options` configuration setting " | 126 raise Exception("The `sass/options` configuration setting " |
| 127 "must be an array of arguments.") | 127 "must be an array of arguments.") |
| 128 | 128 |
| 129 app_root_dir = self.app.root_dir | |
| 130 load_paths = list(self._conf['load_paths']) | |
| 131 for i, lp in enumerate(load_paths): | |
| 132 self._conf['load_paths'][i] = os.path.join(app_root_dir, lp) | |
| 133 | |
| 129 cache_dir = None | 134 cache_dir = None |
| 130 if self.app.cache.enabled: | 135 if self.app.cache.enabled: |
| 131 cache_dir = os.path.join(self.app.cache_dir, 'sass') | 136 cache_dir = os.path.join(self.app.cache_dir, 'sass') |
| 132 self._conf.setdefault('cache_dir', cache_dir) | 137 self._conf.setdefault('cache_dir', cache_dir) |
| 133 | 138 |
| 134 def _getMapPath(self, path): | 139 def _getMapPath(self, path): |
| 135 map_name = "%s_%s.map" % ( | 140 map_name = "%s_%s.map" % ( |
| 136 os.path.basename(path), | 141 os.path.basename(path), |
| 137 hashlib.md5(path.encode('utf8')).hexdigest()) | 142 hashlib.md5(path.encode('utf8')).hexdigest()) |
| 138 map_path = os.path.join(self._map_dir, map_name) | 143 map_path = os.path.join(self._map_dir, map_name) |
| 139 return map_path | 144 return map_path |
| 140 | 145 |
| 141 | 146 |
| 142 def _clean_scheme(p): | 147 def _clean_scheme(p): |
