Rewrite the About page's opening for hikers, name the maintainer swaits, and stop typing counts by hand
Mirror to forge / mirror (push) Canceled after 0s
Validate / validate (push) Canceled after 0s
Validate / history (push) Canceled after 0s
Validate / site (push) Canceled after 0s
Validate / deploy (push) Canceled after 0s

The About page now opens with what the site is for: finding long trails,
including ones the reader has not heard of. The maintainer is shown as swaits,
linked to swaits.com. SOURCES.md no longer carries hand-typed trail counts, and
tests derive the trail and route totals from the records.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-22 10:01:32 -07:00
1 parent ba3e7dfd33
commit d30c56a163
13 files changed
+42 -29

No files matched your search

+5 -7
View File
@@ -267,7 +267,7 @@ BREAD = Markup('<nav class="breadcrumb" aria-label="Breadcrumb"><ol><li><a href=
ABOUT_PARTS = (
# (anchor or path, title, what it is)
("#what-this-is", "What this is", "A guide to the long trails, built from an open dataset"),
("#what-this-is", "What this is", "A place to find long trails, including ones you have not heard of"),
("#how-trails-are-chosen", "How trails are chosen", "The rule, and what held, deferred and candidate mean"),
("#when-a-gpx-is-included", "When a GPX is included", "Whose tracks may be passed on, and routes' authors' terms"),
("/data/", "Data and downloads", "Every trail and track in bulk, the per-trail files and the licences"),
@@ -359,12 +359,10 @@ def about_page(records, site, repo_root):
</div></div>
<div class="container section"><div class="prose doc">
<section aria-labelledby="what-this-is"><h2 id="what-this-is">What this is</h2>
<p>{esc(site.name)} lists {n} long-distance trails in the United States and Canada: where each one goes,
how long it is and takes, when to walk it, and where to get its track. It is built, page by page, from an
open dataset of one text file per trail. Everything a page says about a trail comes from that file.
{f'The dataset is kept in a <a href="{esc(site.repo_url)}">public repository</a>, where anyone can propose a change.' if site.repo_url else ""}</p>
<p>The dataset calls each trail a <em>record</em>, and the pages under About use its terms. The rest of the
site calls them trails.</p>
<p>{esc(site.name)} is a place to find long trails. It gathers {n} long-distance trails and routes in the United States and Canada in one place, from the famous ones to many you have probably never heard of. Each has its own page with where it goes, how long it is, how long it takes, when to walk it, and links to the people who look after it or wrote it up.</p>
<p>The point is discovery. Browse by <a href="/regions/">state or province</a>, by national park, mountain range or wilderness area, or by <a href="/lists/">lists</a> such as loops, trails under 100 miles and trails for each month. Every list can be searched and filtered by length, time, season and more, so you can narrow them down to the few that fit the trip you have in mind, and find ones you did not know to look for.</p>
<p>It is free, with no ads and no accounts. It is not a planning tool: when a trail catches your eye, its page sends you to the official sources, and to a GPX track where one may be shared.</p>
<p><strong>How it is made.</strong> The site is built from an open dataset of one text file per trail, {f'kept in a <a href="{esc(site.repo_url)}">public repository</a>' if site.repo_url else 'kept in a public repository'} where anyone can propose a change. Everything a page says about a trail comes from that file. The dataset calls each trail a <em>record</em>, and the pages under About use its terms. The rest of the site calls them trails.</p>
{what}
</section>
+2 -2
View File
@@ -37,8 +37,8 @@ contact_url = ""
# page's "Who maintains this" and for the home page's Organization and the Dataset in the
# structured data. Both empty: the About page has no such section and the markup names no
# person. No email address and no other personal detail belongs here.
maintainer_name = "Stephen Waits"
maintainer_url = "https://github.com/swaits"
maintainer_name = "swaits"
maintainer_url = "https://swaits.com"
# Google tag container id. When set, every page loads the tag (web/olt/layout.py) to count visits;
# the Content-Security-Policy in web/static/_headers allows it. Empty: no tag.
+1 -1
View File
@@ -59,7 +59,7 @@ class ExtraPagesTest(unittest.TestCase):
def test_all_routes_on_routes_page(self):
routes = [r for r in self.records if r["derived"]["kind"] == "route"]
self.assertEqual(len(routes), 78)
self.assertGreater(len(routes), 0)
page = read_out("routes/index.html")
import html as _html
text = _html.unescape(re.sub(r"<[^>]+>", "", page)) # a credit naming two authors links each name
+1 -1
View File
@@ -380,7 +380,7 @@ class BuiltVocabularyTest(unittest.TestCase):
def test_an_estimated_season_reads_about_on_its_page_and_a_stated_one_does_not(self):
est = [r for r in records.load_records(ROOT) if facets.season_estimated(r)]
stated = [r for r in records.load_records(ROOT) if not facets.season_estimated(r)]
self.assertEqual(len(est) + len(stated), 224)
self.assertEqual(len(est) + len(stated), len(records.load_records(ROOT)))
for rec in est[:10]:
doc = self.read(f"trails/{rec['id']}/index.html")
self.assertIn(facets.season_text(rec), html.unescape(doc), rec["id"])
+1 -1
View File
@@ -114,7 +114,7 @@ class HistorySectionTest(unittest.TestCase):
def test_real_records_all_show_their_history(self):
recs = records.load_records()
self.assertEqual(len(recs), 224)
self.assertGreater(len(recs), 0)
for rec in recs:
part = trail.history_section(rec)
self.assertIn("History of this record", part, rec["id"])
+4 -2
View File
@@ -5,7 +5,7 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from olt import md # noqa: E402
from olt import md, records # noqa: E402
ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
DOCS = ["README.md", "SOURCES.md", "NOTICE.md",
@@ -394,7 +394,9 @@ class RealDocumentsTest(unittest.TestCase):
counter = TableCounter()
counter.feed(md.render(read_doc("README.md")))
counter.close()
self.assertEqual(counter.counts, [146, 78])
recs = records.load_records()
routes = sum(r["derived"]["kind"] == "route" for r in recs)
self.assertEqual(counter.counts, [len(recs) - routes, routes])
def test_readme_num_class_present(self):
self.assertIn('class="num"', md.render(read_doc("README.md")))
+1 -1
View File
@@ -92,7 +92,7 @@ class BuiltSiteTest(unittest.TestCase):
def test_one_detail_page_per_record(self):
found = [d for d in os.listdir(os.path.join(OUT, "trails"))
if os.path.isfile(os.path.join(OUT, "trails", d, "index.html"))]
self.assertEqual(len(self.records), 224)
self.assertEqual(len(self.records), len(records.load_records()))
self.assertEqual(sorted(found), sorted(r["id"] for r in self.records))
self.assertTrue(os.path.isfile(os.path.join(OUT, "index.html")))
+7 -4
View File
@@ -13,10 +13,13 @@ class RecordsTest(unittest.TestCase):
cls.recs = records.load_records()
def test_counts(self):
self.assertEqual(len(self.recs), 224)
self.assertEqual(sum(r["derived"]["kind"] == "route" for r in self.recs), 78)
self.assertEqual(sum(r["derived"]["kind"] == "designated" for r in self.recs), 146)
self.assertEqual(sum(r["derived"]["has_line"] for r in self.recs), 124)
dirs = [d for d in os.listdir(records.ROOT) if os.path.isfile(os.path.join(records.ROOT, d, "trail.toml"))]
self.assertEqual(len(self.recs), len(dirs))
routes = sum(r["derived"]["kind"] == "route" for r in self.recs)
designated = sum(r["derived"]["kind"] == "designated" for r in self.recs)
self.assertEqual(routes + designated, len(self.recs))
self.assertGreater(routes, 0)
self.assertGreater(sum(r["derived"]["has_line"] for r in self.recs), 0)
def test_sorted_by_id(self):
ids = [r["id"] for r in self.recs]
+2 -2
View File
@@ -52,8 +52,8 @@ def sparse_record():
class MaintainerSettings(unittest.TestCase):
def test_site_toml_names_the_maintainer_and_nothing_personal(self):
self.assertEqual(SITE.maintainer_name, "Stephen Waits")
self.assertEqual(SITE.maintainer_url, "https://github.com/swaits")
self.assertEqual(SITE.maintainer_name, "swaits")
self.assertEqual(SITE.maintainer_url, "https://swaits.com")
with open(site.SITE_TOML, encoding="utf-8") as f:
text = f.read()
self.assertNotIn("@", re.sub(r"#.*", "", text), "no email address in the settings")