Skip to content

Commit

Permalink
Added collection attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
lgiordani authored and jeremydw committed Apr 20, 2022
1 parent 9078398 commit b3b3cb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions grow/collections/collection.py
Expand Up @@ -74,6 +74,7 @@ def __init__(self, pod_path, _pod):
self.pod = _pod
self.pod_path = pod_path
self.collection_path = Collection.clean_collection_path(pod_path)
self.dirname = os.path.dirname(self.collection_path)
self.basename = os.path.basename(self.collection_path)
self.blueprint_path = os.path.join(
self.pod_path, Collection.BLUEPRINT_PATH)
Expand Down
2 changes: 2 additions & 0 deletions grow/routing/path_format.py
Expand Up @@ -139,6 +139,8 @@ def params_doc(self, path, doc):
params['collection'] = structures.AttributeDict(
base_path=doc.collection_base_path,
sub_path=doc.collection_sub_path,
path=doc.collection.collection_path,
dirname=doc.collection.dirname,
basename=doc.collection.basename,
root=doc.collection.root)
if '{category}' in path:
Expand Down

0 comments on commit b3b3cb7

Please sign in to comment.