Validate / validate (push) Canceled after 0s
web/ is a static site generator for the dataset, in Python's standard library only. `python3 web/build.py --out _site` writes a page for each of the 138 records, a finder on the home page with a map of the 85 lines, region and route indexes, and the repository's documents as pages. Each line is offered as the record's GeoJSON and as a GPX simplified to 5 m, with two archives of everything. The site's name and address are set in web/site.toml: Long Hikes, at https://longhikes.org. The dataset keeps its own name. netlify.toml and web/static/_headers configure the Netlify site (content types, download dispositions, caching, a content security policy with no inline script). It is deployed with the Netlify CLI from a local build, because Netlify cannot build from this forge. MapLibre GL JS and the two typefaces are vendored under web/assets/; map tiles come from OpenFreeMap. Tests: python3 -m unittest discover -s web/tests (164). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
14 lines
557 B
JavaScript
14 lines
557 B
JavaScript
/* Runs in <head>, before first paint: marks that JavaScript runs, and applies the
|
|
reader's saved theme and length order. Saved by app.js (footer switches). */
|
|
(function () {
|
|
'use strict';
|
|
var root = document.documentElement;
|
|
root.classList.add('js');
|
|
try {
|
|
var theme = localStorage.getItem('lh-theme');
|
|
var units = localStorage.getItem('lh-units');
|
|
if (theme === 'light' || theme === 'dark') root.dataset.theme = theme;
|
|
if (units === 'mi') root.dataset.units = 'mi';
|
|
} catch (e) { /* storage blocked: defaults apply */ }
|
|
})();
|