Say what each page is in the words people search with, and mark up the facts
A whole-site search audit found clean foundations and three gaps: titles without the words people search for, no structured data on trail pages, and trails that did not link to each other. - Trail titles carry the name hikers use, the abbreviation, the length and what the page offers; "GPX" only where the page has one. A new optional `common_name` field holds the name hikers use (13 records). - Descriptions are built from each record, at most 155 characters. - Place and list pages are titled for what they are; heading levels no longer jump. - Trail pages link to similar and related trails and to the lists they belong to. Every trail has at least three links from other trails. - JSON-LD on every page: a Place for each trail, breadcrumbs, item lists on list and place pages, WebSite and Organization on the home page, a fuller Dataset on the data page. - A social card per trail, a changelog feed, `lastmod` in the sitemap from record dates, `noindex` on the 404 and on raw per-trail files, a favicon and an `llms.txt` listing the data files and licences. - The "Considered and left out" page has its spacing fixed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
a46338afd5
commit
5b80fccd1e
245 files changed
+2534
-137
No files matched your search
@@ -456,6 +456,19 @@ def check_elevation(tid, tdir, rec, errors):
|
||||
errors.append(f"{where}: source.computed must be a date (YYYY-MM-DD)")
|
||||
|
||||
|
||||
def check_common_name(tid, rec, errors):
|
||||
"""common_name is optional; where present it is the name hikers use, so it is a clean string that differs from name."""
|
||||
if "common_name" not in rec:
|
||||
return
|
||||
name = rec["common_name"]
|
||||
if not isinstance(name, str) or not name.strip():
|
||||
errors.append(f"{tid}: common_name must be a non-empty string (leave it out when name is the name hikers use)")
|
||||
elif name != name.strip():
|
||||
errors.append(f"{tid}: common_name has a leading or trailing space")
|
||||
elif name == rec.get("name"):
|
||||
errors.append(f"{tid}: common_name repeats name (leave it out when they are the same)")
|
||||
|
||||
|
||||
def check_short_name(tid, rec, errors):
|
||||
"""short_name is optional; where present it needs short_name_url, the page where it was seen in use."""
|
||||
name, url = rec.get("short_name"), rec.get("short_name_url")
|
||||
@@ -692,6 +705,7 @@ def main():
|
||||
if field not in rec or rec[field] in ("", None, []):
|
||||
errors.append(f"{tid}: missing required field {field}")
|
||||
check_short_name(tid, rec, errors)
|
||||
check_common_name(tid, rec, errors)
|
||||
if rec.get("id") != tid:
|
||||
errors.append(f"{tid}: id {rec.get('id')!r} does not match directory name")
|
||||
if rec.get("country") not in ("US", "CA"):
|
||||
|
||||
Reference in new issue
Block a user