# HG changeset patch # User Ludovic Chabant # Date 1408474221 25200 # Node ID 105f24f490cb62d0d9b6122db8561466f726c94b # Parent 3701daa97927b2beffa04b2a467d68a05d27450a Various fixes for the default page source: * Use forward slashes in ref paths * `auto_format` extensions should be stripped * Don't ignore pages with arbitrary extensions diff -r 3701daa97927 -r 105f24f490cb piecrust/sources/base.py --- a/piecrust/sources/base.py Tue Aug 19 11:22:29 2014 -0700 +++ b/piecrust/sources/base.py Tue Aug 19 11:50:21 2014 -0700 @@ -306,6 +306,9 @@ dirnames[:] = list(filter(self._filterPageDirname, dirnames)) for f in filter(self._filterPageFilename, filenames): slug, ext = os.path.splitext(os.path.join(rel_dirpath, f)) + slug = slug.replace('\\', '/') + if ext not in self.supported_extensions: + slug += ext if slug.startswith('./') or slug.startswith('.\\'): slug = slug[2:] if slug == '_index': @@ -353,10 +356,9 @@ def _filterPageFilename(self, f): name, ext = os.path.splitext(f) - return (f[0] != '.' and - f[-1] != '~' and - ext.lstrip('.') in self.supported_extensions and - f not in ['Thumbs.db']) + return (f[0] != '.' and # .DS_store and other crap + f[-1] != '~' and # Vim temp files and what-not + f not in ['Thumbs.db']) # Windows bullshit class DefaultPageSource(SimplePageSource, IPreparingSource,