Add 130 views of the same records, speed up map pages, and say who maintains the site
- New pages built from the records: lists by length, time to walk, month, kind of walking and holder; place-by-list pages; a Triple Crown table and key-figure tables for the National Scenic and Recreation Trails; highest points, most climbing and climb per mile; a page for every route author, with the authors of three or more routes leading the authors page; connected trails; recently added and changed; a glossary and a method page. Every place page opens with a summary. - Trail pages open with an "In brief" paragraph generated from the record and show when the record was last checked. The About page says who maintains the site and how to reach them. - The map starts when it is reached, not with the page. The site's own CSS, scripts and fonts are fingerprinted and cached for a year. Every image has its dimensions. - Titles are held to 60 characters and share previews get their own shorter description. - Social cards are redrawn so a long name can no longer push text into the footer, and the site-wide card takes its wording from the site settings instead of an old hand-made image. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
5b80fccd1e
commit
f2d3b71810
266 files changed
+4658
-252
No files matched your search
+19
-2
@@ -12,7 +12,7 @@ class Site:
|
||||
"""The settings every page needs. Build one with load()."""
|
||||
|
||||
def __init__(self, name, tagline, base_url="", repo_url="", repo_branch="main",
|
||||
contact_url="", name_lang=None, home_title=""):
|
||||
contact_url="", name_lang=None, home_title="", maintainer_name="", maintainer_url=""):
|
||||
if not name:
|
||||
raise ValueError("site.toml: name must not be empty")
|
||||
self.name = name
|
||||
@@ -23,6 +23,10 @@ class Site:
|
||||
self.repo_url = repo_url.rstrip("/")
|
||||
self.repo_branch = (repo_branch or "main").strip() or "main"
|
||||
self.contact_url = contact_url.strip()
|
||||
# Who maintains the site, and the page about them: shown on the About page and
|
||||
# named in the structured data. Both are public by the owner's choice.
|
||||
self.maintainer_name = maintainer_name.strip()
|
||||
self.maintainer_url = maintainer_url.strip()
|
||||
# record id -> language tag of its name ("fr"), for names that are not English
|
||||
self.name_lang = dict(name_lang or {})
|
||||
|
||||
@@ -35,6 +39,18 @@ class Site:
|
||||
"""Where to report an error, or "" when repo_url is unset."""
|
||||
return self.repo_url + "/issues" if self.repo_url else ""
|
||||
|
||||
@property
|
||||
def issue_chooser_url(self):
|
||||
"""The repository's issue chooser (its forms and a blank issue), or "" when repo_url
|
||||
is not a GitHub repository."""
|
||||
return self.repo_url + "/issues/new/choose" if self.repo_url and self.is_github else ""
|
||||
|
||||
@property
|
||||
def contact(self):
|
||||
"""Where to write to the maintainers: contact_url, else the issue chooser, else "".
|
||||
No email address is ever built here; a mailto: contact_url is the owner's own choice."""
|
||||
return self.contact_url or self.issue_chooser_url
|
||||
|
||||
@property
|
||||
def is_github(self):
|
||||
"""True when repo_url is a github.com repository (the only host whose
|
||||
@@ -106,7 +122,8 @@ def from_file(path):
|
||||
base_url=data.get("base_url", ""), repo_url=data.get("repo_url", ""),
|
||||
repo_branch=data.get("repo_branch", "main"),
|
||||
contact_url=data.get("contact_url", ""), name_lang=data.get("name_lang", {}),
|
||||
home_title=data.get("home_title", ""))
|
||||
home_title=data.get("home_title", ""),
|
||||
maintainer_name=data.get("maintainer_name", ""), maintainer_url=data.get("maintainer_url", ""))
|
||||
|
||||
|
||||
@functools.cache
|
||||
|
||||
Reference in new issue
Block a user