# HG changeset patch # User Ludovic Chabant # Date 1518762431 28800 # Node ID 3d71cd95f90ad816d4afc686a734d9f402d43fd5 # Parent e135fd873c45357c1da6c3c4bb0582e21db7a0eb sources: Fix index page slug for ordered page source. diff -r e135fd873c45 -r 3d71cd95f90a piecrust/sources/autoconfig.py --- a/piecrust/sources/autoconfig.py Thu Feb 15 22:26:26 2018 -0800 +++ b/piecrust/sources/autoconfig.py Thu Feb 15 22:27:11 2018 -0800 @@ -103,6 +103,7 @@ for f in filenames: slug, _ = os.path.splitext(f) if slug == route_slug: + path = os.path.join(dirpath, f) metadata = self._createItemMetadata(path) path = os.path.join(dirpath, f) rel_path = os.path.relpath(path, self.fs_endpoint_path) @@ -203,7 +204,10 @@ def _makeSlug(self, path): slug = super()._makeSlug(path) - return self.re_pattern.sub(r'\1', slug) + slug = self.re_pattern.sub(r'\1', slug) + if slug == '_index': + slug = '' + return slug class OrderTrailSortIterator(object):