gvwilson / tidyblocks

A blocks-based interface for tidy data manipulation and analysis.
Other
82 stars 28 forks source link

Modify JS load so that opening index.html directly doesn't cause errors #317

Closed gvwilson closed 4 years ago

gvwilson commented 4 years ago

index.html includes a Jekyll conditional to load either dist_production or dist depending on the value of the JEKYLL_ENV environment variable at the time Jekyll is run to build and serve the site. This means that if someone builds the dev version, then opens index.html directly, the browser tries to load the production version, fails, then tries and succeeds with the development version, resulting in some error messages in the console. Can we use something like https://stackoverflow.com/questions/15521343/conditionally-load-javascript-file to encapsulate the loading so that developers don't get these error messages?

DarkMetroid commented 4 years ago

Seems worthwhile, I think if we just want it to work on it's own we can't use JEKYLL_ENV (you'll notice a weird gap after the menu bar currently caused by Jekyll's frontmatter syntax not being handled).

I feel like trying to dynamically change things based on reading an environment variable gets too messy (trying to change what files point to). Let me see if I can find some way for the Github Action to just copy the actual /dist/ folder (maybe I can remove the .gitignore file when we move to gh-pages).