mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Set "modified:" from "date:" when the latter was set from the filesystem (#2748)
Sets the `modified:` metadata from `date:` if the user asked us to use the filesystem for determining timestamps. Fixes #2497 * Added tests (ab)using the HTML reader a bit There seems to be no way to test this generically since we need to produce a valid document with meta information to be able to compare, hence I used the lightest reader out there to do the parsing of the samples. * Fixed tests for generators since there were 4 more articles introduced to the test content directory.
This commit is contained in:
parent
c8639fe547
commit
e6df353302
7 changed files with 113 additions and 0 deletions
|
|
@ -685,6 +685,7 @@ def path_metadata(full_path, source_path, settings=None):
|
|||
if settings.get('DEFAULT_DATE', None) == 'fs':
|
||||
metadata['date'] = datetime.datetime.fromtimestamp(
|
||||
os.stat(full_path).st_mtime)
|
||||
metadata['modified'] = metadata['date']
|
||||
|
||||
# Apply EXTRA_PATH_METADATA for the source path and the paths of any
|
||||
# parent directories. Sorting EPM first ensures that the most specific
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue