Rebuild the site for people browsing trails
The site read like a database. It is now a place to find and read about long trails, and everything on it is still derived from the records. - One kind of thing: a trail. A route is a kind of trail, explained where the word first appears. The navigation is Trails, Places, About. - The home page is the catalogue, with filters for where, length, time, season, terrain, kind, walking, shape and GPX. A filter is offered only when at least a third of the trails have a value for it. - Lists (for example National Scenic Trails and Routes) and a Places page that groups states and provinces into regions. - A trail page leads with what a hiker needs: summary, at a glance, map, downloads, elevation profile and where to go next. The dataset's own fields sit in a collapsed "About this data" section. - The trail list is a compact card on phones and beside the filters, and a column table where it has the full page width. - web/serve.py takes --bind, for viewing from another device. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
efb6164737
commit
b817d2097b
21 files changed
+3468
-719
No files matched your search
+5
-3
@@ -4,7 +4,7 @@
|
||||
For checking pages under the production Content-Security-Policy (Netlify
|
||||
applies _headers in production; plain `python3 -m http.server` does not).
|
||||
|
||||
python3 web/serve.py [--dir _site] [--port 8000]
|
||||
python3 web/serve.py [--dir _site] [--port 8000] [--bind 127.0.0.1]
|
||||
"""
|
||||
import argparse
|
||||
import functools
|
||||
@@ -74,11 +74,13 @@ def main():
|
||||
ap = argparse.ArgumentParser(description=__doc__.splitlines()[0])
|
||||
ap.add_argument("--dir", default=os.path.join(root, "_site"))
|
||||
ap.add_argument("--port", type=int, default=8000)
|
||||
ap.add_argument("--bind", default="127.0.0.1",
|
||||
help="address to listen on; 0.0.0.0 lets other devices on the network reach it")
|
||||
args = ap.parse_args()
|
||||
Handler.rules = parse_headers(os.path.join(args.dir, "_headers"))
|
||||
handler = functools.partial(Handler, directory=args.dir)
|
||||
with http.server.ThreadingHTTPServer(("127.0.0.1", args.port), handler) as httpd:
|
||||
print(f"serving {args.dir} at http://127.0.0.1:{args.port}/ with {len(Handler.rules)} header rules")
|
||||
with http.server.ThreadingHTTPServer((args.bind, args.port), handler) as httpd:
|
||||
print(f"serving {args.dir} at http://{args.bind}:{args.port}/ with {len(Handler.rules)} header rules")
|
||||
httpd.serve_forever()
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user