Mercurial > piecrust2
comparison piecrust/baking/single.py @ 835:cc9593b9bcbf
Land assets in the correct directory for pages with no pretty_urls override
author | Ben Artin <ben@artins.org> |
---|---|
date | Tue, 03 Jan 2017 02:34:43 -0500 |
parents | 10c482d57c79 |
children | dca51cd8147a |
comparison
equal
deleted
inserted
replaced
834:10c482d57c79 | 835:cc9593b9bcbf |
---|---|
82 | 82 |
83 while has_more_subs: | 83 while has_more_subs: |
84 # Get the URL and path for this sub-page. | 84 # Get the URL and path for this sub-page. |
85 sub_uri = qualified_page.getUri(cur_sub) | 85 sub_uri = qualified_page.getUri(cur_sub) |
86 logger.debug("Baking '%s' [%d]..." % (sub_uri, cur_sub)) | 86 logger.debug("Baking '%s' [%d]..." % (sub_uri, cur_sub)) |
87 out_path = self.getOutputPath(sub_uri, qualified_page.pretty_urls) | 87 pretty_urls = qualified_page.pretty_urls if qualified_page.pretty_urls is not None else self.pretty_urls |
88 out_path = self.getOutputPath(sub_uri, pretty_urls) | |
88 | 89 |
89 # Create the sub-entry for the bake record. | 90 # Create the sub-entry for the bake record. |
90 sub_entry = SubPageBakeInfo(sub_uri, out_path) | 91 sub_entry = SubPageBakeInfo(sub_uri, out_path) |
91 sub_entries.append(sub_entry) | 92 sub_entries.append(sub_entry) |
92 | 93 |
155 sub_entry.render_info = rp.copyRenderInfo() | 156 sub_entry.render_info = rp.copyRenderInfo() |
156 | 157 |
157 # Copy page assets. | 158 # Copy page assets. |
158 if (cur_sub == 1 and self.copy_assets and | 159 if (cur_sub == 1 and self.copy_assets and |
159 sub_entry.anyPass(lambda p: p.used_assets)): | 160 sub_entry.anyPass(lambda p: p.used_assets)): |
160 if qualified_page.pretty_urls: | 161 if pretty_urls: |
161 out_assets_dir = os.path.dirname(out_path) | 162 out_assets_dir = os.path.dirname(out_path) |
162 else: | 163 else: |
163 out_assets_dir, out_name = os.path.split(out_path) | 164 out_assets_dir, out_name = os.path.split(out_path) |
164 if sub_uri != self.site_root: | 165 if sub_uri != self.site_root: |
165 out_name_noext, _ = os.path.splitext(out_name) | 166 out_name_noext, _ = os.path.splitext(out_name) |