miguelgrinberg / turbo-flask

Integration of Hotwire's Turbo library with Flask.
MIT License
301 stars 35 forks source link

Using Turbo.js from local static folder #31

Closed reghardtp closed 2 years ago

reghardtp commented 2 years ago

Hi, I am trying to run Flask-Turbo without being connected to the internet (so the CDN is inaccessible)

I see that there is an optional argument when initializing Turbo(), url.

I am trying to populate URL in the following way:

{{ turbo(url="{{ url_for('static', filename='javascript/turbo.js') }}") }}

I checked that the static file URL is correct.

However, Turbo doesn't give any errors, but also doesn't initialize.

I downloaded the Turbo.js source:

curl https://cdn.skypack.dev/-/@hotwired/turbo@v7.1.0-RBjb2wnkmosSQVoP27jT/dist=es2020,min/@hotwired/turbo.js --output turbo.js

And put the output js file in static/javascript

Thanks!

miguelgrinberg commented 2 years ago

Duplicate of https://github.com/miguelgrinberg/turbo-flask/issues/26

reghardtp commented 2 years ago

Apologies for not seeing the other issue. Thanks for the quick response!