-
Notifications
You must be signed in to change notification settings - Fork 4
Fixing Simply Static output
Simply Static does not interpret JavaScript files (AFAIK), and is thus unable to capture the files referenced within JavaScript files. So, we need to do some tinkering.
See https://github.com/OpenDRR/riskprofiler-cms/blob/main/bin/fix-website-for-static-hosting.sh for a work-in-progress.
- Rename the script
- Instead of fetching from HabitatSeven's demo site, copy them from local Git repo instead, and perhaps even interpret the PHP locally.
- Rename my fake .php files to .html
Starting from where fix-website-for-static-hosting.sh left off:
DevTools failed to load source map: Could not load content for http://test.riskprofiler.local/site/assets/themes/fw-child/resources/vendor/Highcharts-9.3.3/code/modules/export-data.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://test.riskprofiler.local/site/assets/themes/fw-child/resources/css/highcharts.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://test.riskprofiler.local/site/assets/themes/fw-child/resources/vendor/Highcharts-9.3.3/code/highcharts.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://test.riskprofiler.local/site/assets/themes/fw-child/resources/vendor/Highcharts-9.3.3/code/modules/exporting.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
Solution: Add
site/assets/themes/fw-child/resources/vendor/Highcharts-9.3.3/code/modules/export-data.js.map
site/assets/themes/fw-child/resources/css/highcharts.css.map
site/assets/themes/fw-child/resources/vendor/Highcharts-9.3.3/code/modules/exporting.js.map
site/assets/themes/fw-child/resources/vendor/Highcharts-9.3.3/code/modules/exporting.js.map
to missing_files
array.
Or: Can we tell Simply Static to include *.map files too? To test. (my last try didn't work for some reasons, but I didn't try very hard.)
detail SIM9p0_CascadiaInterfaceBestFault - rp_scenarios.js:1117
Failed to load resource: the server responded with a status of 404 (Not Found) http://test.riskprofiler.local/site/assets/themes/fw-child/template/https://riskprofiler-demo-site/scenario/cascadia-interface-best-fault/
detail done - rp_scenarios.js:1172
Thanks to the debug messages that HabitatSeven put in, I was able to zero in site/assets/themes/fw-child/resources/js/rp_scenarios.js Lines 1134-1137:
// load the detail sidebar template
$(document).profiler('get_sidebar', {
url: plugin_settings.scenario.url,
where plugin_settings.scenario.url
has the value https://riskprofiler-demo-site/scenario/cascadia-interface-best-fault/
.
Wikis: data | model-factory | opendrr-api | opendrr | python-env | riskprofiler-cms