Mercurial > piecrust2
diff piecrust/sources/posts.py @ 926:86b684cc0551
sources: Add `findContentFromPath` API.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 01 Oct 2017 20:37:11 -0700 |
parents | c445a3d5d950 |
children | b61dd60aff36 |
line wrap: on
line diff
--- a/piecrust/sources/posts.py Sun Oct 01 20:36:38 2017 -0700 +++ b/piecrust/sources/posts.py Sun Oct 01 20:37:11 2017 -0700 @@ -109,6 +109,10 @@ metadata = self._parseMetadataFromPath(path) return ContentItem(path, metadata) + def findContentFromPath(self, path): + metadata = self._parseMetadataFromPath(path) + return ContentItem(path, metadata) + def _parseMetadataFromPath(self, path): regex_repl = { 'year': '(?P<year>\d{4})',