comparison piecrust/baking/single.py @ 473:eb3ace870708 2.0.0a13

bake: Fix a bug with copying assets when `pretty_urls` are disabled. Added unit tests.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 14 Jul 2015 23:59:08 -0700
parents dc78ade3f320
children 16e705c58cae
comparison
equal deleted inserted replaced
472:dc78ade3f320 473:eb3ace870708
129 out_assets_dir = os.path.dirname(out_path) 129 out_assets_dir = os.path.dirname(out_path)
130 else: 130 else:
131 out_assets_dir, out_name = os.path.split(out_path) 131 out_assets_dir, out_name = os.path.split(out_path)
132 if sub_uri != self.site_root: 132 if sub_uri != self.site_root:
133 out_name_noext, _ = os.path.splitext(out_name) 133 out_name_noext, _ = os.path.splitext(out_name)
134 out_assets_dir += out_name_noext 134 out_assets_dir = os.path.join(out_assets_dir,
135 out_name_noext)
135 136
136 logger.debug("Copying page assets to: %s" % out_assets_dir) 137 logger.debug("Copying page assets to: %s" % out_assets_dir)
137 _ensure_dir_exists(out_assets_dir) 138 _ensure_dir_exists(out_assets_dir)
138 139
139 page_pathname, _ = os.path.splitext(qualified_page.path) 140 page_pathname, _ = os.path.splitext(qualified_page.path)