Browse Source

org_reader: On read, process the metadatas

Gendre Sébastien 7 years ago
parent
commit
c30f11c555
1 changed files with 7 additions and 3 deletions
  1. 7 3
      org_reader/org_reader.py

+ 7 - 3
org_reader/org_reader.py

@@ -73,14 +73,18 @@ class OrgReader(BaseReader):
         Keyword Arguments:
         source_path -- Path to the Org file to parse
         """
-        self._source_path = source_path
-        with pelican_open as text:
+        with pelican_open(source_path) as text:
             text_lines = list(text.splitlines())
 
         header, content = self._separate_header_and_content(text_lines)
         metadatas = self._parse_metadatas(header)
+        metadatas_processed = {
+            key
+            : self.process_metadata(key, value)
+            for key, value in metadatas.items()
+        }
         content_html = org_to_html("\n".join(content))
-        return content_html, metadatas
+        return content_html, metadatas_processed
     
 def add_reader(readers):
     for ext in OrgReader.file_extensions: