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

Compatibility with mknotebooks and type: timeago #40

Closed timvink closed 3 years ago

timvink commented 4 years ago

When inserting jupyter notebooks, the revisiondate remains blank when using type: timeago:

image

The info is there:

<div class="md-source-date"> 
<small> Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-timeago"><span class="timeago" datetime="2020-07-14T14:18:15+00:00" locale="en"></span></span><span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-iso_date">2020-07-14</span> </small>
</div>

But it looks like the javascript injection does not work properly. Possibly #39 might fix this

timvink commented 4 years ago

Released v.0.7.3 that addresses this.

timvink commented 3 years ago

This seems to be an issue again, with javascript injection not working properly.

timvink commented 3 years ago

so timeago is not loaded by javascript:

image

but the injection is there:

image

It works fine on pages that are not notebooks. I'm quite puzzled with this one.

timvink commented 3 years ago

It might have to do with the page being re-rendered:

https://github.com/greenape/mknotebooks/blob/eb467013b3c11775f9316862068ee4e4a0511ccc/mknotebooks/plugin.py#L296-L304

timvink commented 3 years ago

Having a look at the linked issue, it seems the cause is outside of this plugin.

Once that issue has been addressed, it can be tested (manually) using a fixture included in this repo:

mkdocs serve -f tests/fixtures/with_mknotebooks/mkdocs.yml

timvink commented 3 years ago

Works again after the latest update of mknotebook version 0.7.1 !