# HG changeset patch # User Ludovic Chabant # Date 1517203292 28800 # Node ID f8572df0756eb5196d7509320a639035f36fca68 # Parent 971b4d67e82ab9e92ab818404f17be25aa3b3e90 serve: Fix crash with autoconfig source pages when serving. diff -r 971b4d67e82a -r f8572df0756e piecrust/sources/autoconfig.py --- a/piecrust/sources/autoconfig.py Fri Jan 26 18:05:02 2018 -0800 +++ b/piecrust/sources/autoconfig.py Sun Jan 28 21:21:32 2018 -0800 @@ -103,10 +103,11 @@ for f in filenames: slug, _ = os.path.splitext(f) if slug == route_slug: + metadata = self._createItemMetadata(path) path = os.path.join(dirpath, f) rel_path = os.path.relpath(path, self.fs_endpoint_path) config = self._extractConfigFragment(rel_path) - metadata = {'slug': slug, 'config': config} + metadata.setdefault('config', {}).update(config) return ContentItem(path, metadata) return None @@ -170,9 +171,10 @@ if not found: return None + metadata = self._createItemMetadata(path) rel_path = os.path.relpath(path, self.fs_endpoint_path) config = self._extractConfigFragment(rel_path) - metadata = {'slug': uri_path, 'config': config} + metadata.setdefault('config', {}).update(config) return ContentItem(path, metadata) def getSorterIterator(self, it):