diff --git a/docs/themes.rst b/docs/themes.rst index 3978e693..b2b43699 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -230,6 +230,8 @@ Variable Description ============= =================================================== article The article object to be displayed category The name of the category for the current article +mdate The article modification date and time as it + appears in the filesystem ============= =================================================== Any metadata that you put in the header of the article source file diff --git a/pelican/readers.py b/pelican/readers.py index 46055962..2cf23a71 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -632,6 +632,8 @@ def path_metadata(full_path, source_path, settings=None): os.stat(full_path).st_mtime) metadata.update(settings.get('EXTRA_PATH_METADATA', {}).get( source_path, {})) + metadata['mdate'] = SafeDatetime.fromtimestamp( + os.stat(full_path).st_mtime) return metadata