Skip to content
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

why does timeago type need cloudflare #42

Closed
FarisZR opened this issue Oct 25, 2020 · 5 comments
Closed

why does timeago type need cloudflare #42

FarisZR opened this issue Oct 25, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@FarisZR
Copy link

FarisZR commented Oct 25, 2020

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 timvink added the enhancement New feature or request label Oct 26, 2020
@timvink
Copy link
Owner

timvink commented Oct 26, 2020

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

# Insert timeago.js dependencies
extra_js = """
<script src="https://cdnjs.cloudflare.com/ajax/libs/timeago.js/4.0.0-beta.2/timeago.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/timeago.js/4.0.0-beta.2/timeago.locales.min.js"></script>

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
Copy link
Author

FarisZR commented Oct 26, 2020

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

# Insert timeago.js dependencies
extra_js = """
<script src="https://cdnjs.cloudflare.com/ajax/libs/timeago.js/4.0.0-beta.2/timeago.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/timeago.js/4.0.0-beta.2/timeago.locales.min.js"></script>

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
Copy link
Owner

timvink commented Oct 26, 2020

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

@timvink
Copy link
Owner

timvink commented Oct 26, 2020

Released v.0.7.3 that addresses this.

@timvink timvink closed this as completed Oct 26, 2020
@FarisZR
Copy link
Author

FarisZR commented Oct 26, 2020

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants