timvink / mkdocs-git-revision-date-localized-plugin

MkDocs plugin to add a last updated date to your site pages
https://timvink.github.io/mkdocs-git-revision-date-localized-plugin/index.html
MIT License
206 stars 44 forks source link

Feature Request: Use file last modified timestamp if there is no git info #146

Closed Ptyool closed 1 month ago

Ptyool commented 1 month ago

Hi, Would it be possible to change the behavior, from using the current time if there is no git info, to using the file last modified timestamp : https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/blob/3f39e6558213de330b4fbb5e6473aaf95a07713c/src/mkdocs_git_revision_date_localized_plugin/util.py#L142 Thank you.

timvink commented 1 month ago

That works on your local machine, but if you use a build system it's meaningless (because the repo is cloned somewhere else). That will mean inconsistent behaviour & a lot of confusion (=bug reports)

Ptyool commented 1 month ago

Hi, I understand why you don't want to change the default behavior, however it could be an option of the plugin. Our use case is to add doc from other repo, so there is no git log for those files, but we are able to retrieve the last modification time and set the correct mtime on those files before "mkdoc build". Thank you.

timvink commented 1 month ago

If I add an option, I will still have to maintain it, and make sure the different combinations of settings make sense. I prefer this plugin to do 1 thing well.

Some alternatives you can consider/research:

timvink commented 1 month ago

Closing as won't implement