I don't find, what can I do, that Date and Modified would be determined automatically.
If it not possible at the time, it would be nice to have this feature.
I print in my articles and pages:
Date — date of file creation;Modified — date of last file modification.This is not hard to determine automatically in Python. But in Pelican I need to wrote 2 Metadata extra lines Date and Modified in every my article/page. I don't need manually write 2 extra lines when I can do it automatically.
filetime_from_git can solve this issue, if I deploy a site from local machine. But for remote site deploying I have problems, see #813 for details.
On Stack Overflow I find this question about similar problem, but I don't understand, how I can accept it for each article/page, not for specific; see my comment.
Thanks.
From this, you can auto-set the creation date with DEFAULT_DATE='fs', which collects a date from the current system timestamp.
Note that articles without a metadata creation date, if modified, will update this date to the new system timestamp.
I am unsure about automating the modification date at this time.
@Kristinita: I don't think it's advisable to rely upon the file creation date as supplied by the file system's ctime attribute. In my experience, that value can be "reset" all too easily to the current date, potentially misleading/confusing the audience and leaving you in a state where even you don't remember when the content was originally published. For this reason, I think it's best to at least record the original creation date in your content metadata.
The post date can already be determined from the mtime attribute, which means in theory you could do the following:
Created metadata field and modify your theme to use it as your "Posted" date.DEFAULT_DATE='fs' as @rask004 suggested and modify your theme to use date as your "Last modified" date.That way, instead of entering two dates, you would only have to enter one date in your post metadata. Otherwise, you could submit a pull request that adds more flexible post creation/modification date handling. Alternatively, you could look at how some other date-related plugins work and develop one that adds date handling that more closely matches your desired use case.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your participation and understanding.
I would argue that the original issue is indeed present and that currently implemented logic is sub-optimal.
For example my workflow is the following:
date: metadata field since it is a one offmodified: field.I would argue that the creation date is a one time thing which describes when the artefact was created, while the modification date is a fluid thing that should be updated every time the artefact is touched, therefore I propose to implement the following logic instead of what we currently have:
DEFAULT_DATE='fs' then get the mtime from the filesystem and set both 'date:' and 'modified:' meta fields to the retrieved timestampThis logic allows to serve everybody's needs:
date: in your header only (this will result in modified: being populated from the filesystem;:)
@justinmayer , I can work on this logic and submit a PR, if you are interested (I cannot re-open the issue, though)
You can't (easily) get "creation date" from filesystem on some systems (ref).
If you're not using CACHE_*, "new" doesn't mean much to pelican. Or to say it differently, everything is "new" at each run.
But, sure you have an issue now @galaxy4public :).
I was not after detecting true creation time, all I wanted is to automate something everybody is silently hating :) as to manually update modified:. The PR is coming and it is just one line in readers.py.