From b845db30de56d3177f4a9f1b4ce05049f9ac3aa3 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Tue, 3 Apr 2012 11:58:31 +0200 Subject: [PATCH] Add a way to know what metadata exists. This allows in a theme to have a look at the "metadata" attribute of a content to know what are the metadata fields defined by it. --- pelican/contents.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pelican/contents.py b/pelican/contents.py index 8e6f2dca..42de4560 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -41,6 +41,9 @@ class Page(object): for key, value in local_metadata.items(): setattr(self, key.lower(), value) + # also keep track of the metadata attributes available + self.metadata = local_metadata + # default author to the one in settings if not defined if not hasattr(self, 'author'): if 'AUTHOR' in settings: