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
193 stars 39 forks source link

Timeago setting results in incorrect items being added to extra_javascript #117

Closed nint8835 closed 1 year ago

nint8835 commented 1 year ago

As of mkdocs 1.5, extra_javascript after the config is no longer an array of strings, but is instead a list of ExtraScriptValue.

Mkdocs appears to have fallback logic that handles the strings this plugin inserts into the list, but it can cause issues for plugins that assume all objects in the list are of the expected type (such as Material for Mkdocs, which is how I encountered this https://github.com/squidfunk/mkdocs-material/issues/5778)

oprypin commented 1 year ago

I came to a conclusion that we'll never get rid of strings being put into extra_javascript, so instead it will be officially embraced.

MkDocs itself will now also normally put strings into the list. So perhaps nothing to do here.

timvink commented 1 year ago

Late reply, but thanks both!

Indeed currently using strings in extra_javascript:

https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/blob/6150fad41a83abbf7500cf9c75696c5193532305/mkdocs_git_revision_date_localized_plugin/plugin.py#L124-L132