Closed michalzobec closed 3 years ago
Hi @michalzobec. Good to hear it's useful for you!
So if I understand correctly, you would like the revision date to be based off of a page meta variable like PublishedDate
, instead of the last git commit on a file?
The date would have to be in ISO8601 format, and the variable name to look for should be configurable in the config.
Could be useful, but not sure if it fits in the scope of the plugin (which is revision-date based on git). I'll think about it, and also wait and see if some users upvote the issue.
Hello @timvink
thank you for your fast reply :)
So if I understand correctly, you would like the revision date to be based off of a page meta variable like
PublishedDate
, instead of the last git commit on a file?
sorry, no. I need use both, your information, and my information (variable).
your plugin inserts information about last update. my variable inserts the date of first publish of same article.
for examle:
Published: <some date here>
Last update: <some date here>
Last update is your information from your plugin. Published is my information from my variable in same article.
Here is real example: https://pomoc2.zobecdev.cz/testpage/
you will found on begin of page:
Vydáno: 01.12.2020 14:00:00
Změněno: 27. února 2021 22:38:39
It is clear for you now? :)
The date would have to be in ISO8601 format, and the variable name to look for should be configurable in the config.
yes, I understand that. :)
Have nice day.
Michal
Oh I see. The {{ page.meta.git_revision_date_localized }}
tag has been embedded into mkdocs-material
(see https://github.com/squidfunk/mkdocs-material/blob/master/material/partials/source-date.html), which is why you don't need an override for that one.
Using overrides is the preferred way to go. You can improve your setup by overriding the source-date.html
instead of main.html
, which will make your customization much more stable (as mkdocs-material's main.html
is updated much more frequently, meaning you will have to update your override more often).
yeah, but if you add you support for custom meta variable (to your plugin), I do not must use override. and that's why I asked you, for exactly the reasons you're giving. so that I don't have to deal with customizations at all and have problems with upgrades.
Initially to use this plugin's {{ page.meta.git_revision_date_localized }}
with mkdocs-material
theme, you also needed to use an override. Because so many people use this plugin, I was able to convince the author of mkdocs-material
to update his template to include it.
If you want support for your PublishedDate
variable inside mkdocs-material
, you will have to open an issue in that repository. Overriding partials is the preferred way of extending a theme, and mkdocs-material
providing the very specific partials/source-date.html
makes it really easy already. But if you can make a strong case in an issue to mkdocs-material perhaps you will be able to convince the author.
ahh, okay, thanks :)
Hello,
thank you very much for your plugin. is very useful for me and it works.
but I have one little problem, because it automatically generate at end of article information about last update.
I have my custom meta variable PublishedDate like
it is possible add of support of this variable from your side? because I would like to avoid editing the template, if is possible.
and if is possible define of possition of update information in article (top/end), it will be great. :)
thank you very much for your help.