Mercurial > piecrust2
comparison piecrust/baking/single.py @ 515:16e705c58cae
internal: Improve handling of taxonomy term slugification.
This paves the way to bring slugification options like transliteration to
PieCrust. This change mostly makes sure we use one-way slugification, which
means, for serving/previewing, we need to slugify each page's terms to compare
to the stuff captured from the URL. It also simplifies things a bit in the
code.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 26 Jul 2015 23:16:15 -0700 |
parents | eb3ace870708 |
children | 59268b4d8c71 |
comparison
equal
deleted
inserted
replaced
514:c9c305645e5f | 515:16e705c58cae |
---|---|
155 return sub_entries | 155 return sub_entries |
156 | 156 |
157 def _bakeSingle(self, qualified_page, num, out_path, tax_info=None): | 157 def _bakeSingle(self, qualified_page, num, out_path, tax_info=None): |
158 ctx = PageRenderingContext(qualified_page, page_num=num) | 158 ctx = PageRenderingContext(qualified_page, page_num=num) |
159 if tax_info: | 159 if tax_info: |
160 tax = self.app.getTaxonomy(tax_info.taxonomy_name) | 160 ctx.setTaxonomyFilter(tax_info.term) |
161 ctx.setTaxonomyFilter(tax, tax_info.term) | |
162 | 161 |
163 rp = render_page(ctx) | 162 rp = render_page(ctx) |
164 | 163 |
165 out_dir = os.path.dirname(out_path) | 164 out_dir = os.path.dirname(out_path) |
166 _ensure_dir_exists(out_dir) | 165 _ensure_dir_exists(out_dir) |