New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Add Created and Updated datetime on all page #1408
Comments
Using the git commit date/time is reliant upon using git. Of course, not all MkDocs users use git for their documentation. A specific feature like that would be a good candidate for a third party Plugin. A more general approach would be to use the "build date" which we already make available via the In short, if you want the "build date" we don't need to do anything. If you want something more specific, you are welcome to create a plugin to address your specific needs. Again there is no need for MkDocs to do anything. |
I should also note that using local file system created and/or modified dates are not reliable either. Someone could create a new clone of a repo today and have "created" dates of today for the local files. Of course that wouldn't necessarily line up with the commit dates. The point is that the only way to get reliable dates/times is to use the version control system's dates/times. However, MkDocs does not enforce any specific version control system(s). So a general solution would be difficult, if not impossible, to build and maintain without limiting the usefulness to specific users only. Therefore, that sort of thing is best served by a third party plugin. One person builds a git specific plugin and someone else can build a mercurial specific plugin and so on. |
Perhaps it would be interesting to have |
@biochimia actually I think plugin creators should experiment and find what works best. If, at some point in the future, a single approach becomes wildly popular, then we can explore bringing that plugin in-house at that time. |
Hey everyone! Looking to use a feature like this, is there any consensus on if this is coming down the pipe? |
@GaryPWhite It seems that mkdocs is not adding this feature, you can call github api by your self actually. My code: https://github.com/24OI/OI-wiki/blob/master/static/extra.js#L33 |
@GaryPWhite You can use my simple plugin here: mkdocs-git-revision-date-plugin This will fill in |
@zhaoterryy Hi, how to use your plugin? should I clone the repo to somewhere or install via pip? Thx |
Right.. sorry about that.
|
You'll also need to add |
@zhaoterryy you might want to add your plugin to the list on the wiki so others can find it. |
It's would be nice to see how recent the document is, like:
The Created and Update datetime information can be get from git repository, based on the first and last commit affect to the file.
Reference:
The text was updated successfully, but these errors were encountered: