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

why does timeago type need cloudflare #42

Closed FarisZR closed 4 years ago

FarisZR commented 4 years ago

hi, i have noticed that when using type: timeago it requests js files from cdnjs.cloudflare.com. could this be replaced with local files? is this really necessary ?

timvink commented 4 years ago

Hi @fareszr ,

You observation is right, when using type: timeago we need to insert the timeago javascript library in order to be able to render the date dynamically

https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/blob/c53dea53a23b6e110a420de80347c5ad1069f75c/mkdocs_git_revision_date_localized_plugin/plugin.py#L160-L163

could this be replaced with local files?

Yes, it could be.

is this really necessary ?

The timeago.js library is really necessary, but using a CDN isn't.

I agree local files files would be better, so the plugin works locally without internet.

FarisZR commented 4 years ago

Hi @fareszr ,

You observation is right, when using type: timeago we need to insert the timeago javascript library in order to be able to render the date dynamically

https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/blob/c53dea53a23b6e110a420de80347c5ad1069f75c/mkdocs_git_revision_date_localized_plugin/plugin.py#L160-L163

could this be replaced with local files?

Yes, it could be.

is this really necessary ?

The timeago.js library is really necessary, but using a CDN isn't.

I agree local files files would be better, so the plugin works locally without internet.

Would like to have an oprion to add the files in the mkdocs config

timvink commented 4 years ago

This should be the default behaviour, I don't see a use-case why you would prefer a CDN over local files?

timvink commented 4 years ago

Released v.0.7.3 that addresses this.

FarisZR commented 4 years ago

thanks!