diff --git a/CHANGELOG.md b/CHANGELOG.md index 7079b7c..2bfe099 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 2026-11-17 - Every page that shows trails has one layout, and the site sets no tables + +- Every page that shows a set of trails now has the same layout: the home page, every place page, every list, the Routes page, the route authors, the Triple Crown, the rankings and the newest trails. Under the page's name and its one line come the trails as rows, with their map beside them on the right. The map stays in view as the rows scroll. This holds from 900 px wide up, so at 1,187 px and at a tablet held sideways the map is beside the trails, not under them. On a narrower screen the map is a short band above the rows, a third of the screen high at most, never below the list. +- A map frame takes the shape of the ground it shows, between a little taller than wide and a little more than half as tall as wide, so the tracks fill it. The drawing in the page and the live map fit the same ground in the same frame, as before. +- Text about a set of trails now comes after the rows, under its own heading, and is one short paragraph: the longest and shortest, the loops and routes, the most common terrain and the highest point on file. The quickest and slowest to walk, the designations, a place's share of the trails and which place has the most are gone. A list's explanation of how it is picked is there too. +- The home page opens with its headline and one sentence on the contour ground of the old hero, at a fraction of its height. The ten lists are one quiet line of links under it, ending in "All lists". The search, Filters and Clear are over the rows. Open, the filters lie over the rows instead of pushing the page down, and "Show the trails", Escape or a click outside closes them. The Places page's links to the parts of the country are the same kind of line. +- A trail page now has its actions in its head: the GPX, the trail's own site and Save stand at the right, over the At a glance panel, on a wide screen, and in one row under the name on a phone. Directly under the head are the map and At a glance, tops level. The map frame is the same calm landscape on every trail page, 3 by 2 (4 by 3 on a phone), with the track fitted inside it. Under the map are the summary, the "In brief" paragraph and "Last checked" in small print. Under At a glance are the downloads and the map's credit, which used to fill the caption under the map. On a phone a strip of the length, time and states comes before the map. +- At a glance sets the length larger. A built length or a whole-system figure is a line of its own across the panel. A trail name too long for two lines is set a step smaller. +- No page sets a table. The National Scenic Trails and National Recreation Trails lists lost their tables of figures and are lists like the others. The Triple Crown is its three trails as rows with their map, each row adding its high point, climb and year designated. The rankings are the trails as rows in rank order, each led by its rank and its figure. The route authors with the most routes lead `/authors/` with their routes as rows, and an author's page shows their routes as rows with their guides. The trails considered and left out, the newest changes, the places on `/numbers/`, and the tables on the About, data, schema, sources and method pages are rows in the same language: a name, a sentence and a line of short facts. Every field of a record, at the foot of its page, is a list of fields and values. +- No trail's facts changed. + ## 2026-11-16 - Fifteen more main tracks re-cut to one walk - The rule that a trail's length is one end-to-end walk, with one branch at a split, was applied to the tracks built from OpenStreetMap. A scan of all of them looked for a main track that holds two different ways between the same two points, which is what a split looks like in the geometry, and found fifteen. Each of those tracks is now one walk. The other way is in `alternates.geojson`, or, where it was the same road mapped twice, left out. Lengths below are the measured track before and after, in miles (kilometres). No published length (`length_km`) changed, and each record has a history entry. diff --git a/web/assets/app.js b/web/assets/app.js index d3118ce..21bc630 100644 --- a/web/assets/app.js +++ b/web/assets/app.js @@ -1346,6 +1346,8 @@ 'time-asc': 'time-desc', 'time-desc': 'time-asc', 'climb-desc': 'climb-asc', 'climb-asc': 'climb-desc' }; /* The Saved page's list also has the order saved (rows numbered in data-order by section 1c). */ if (savedPage) SORT_KEYS.saved = 1; + /* A ranking (/numbers/) has its rank as an order (rows numbered in data-rank by the page). */ + if (document.querySelector('.entry[data-rank]')) SORT_KEYS.rank = 1; function normalizeSortKey(value, dflt) { if (SORT_KEYS[value]) return value; @@ -1363,6 +1365,7 @@ var bo = b.dataset.order ? Number(b.dataset.order) : Infinity; return cmpNum(ao, bo) || cmpStr(an, bn); } + if (key === 'rank') return cmpNum(Number(a.dataset.rank || Infinity), Number(b.dataset.rank || Infinity)); if (key === 'name') return cmpStr(an, bn); if (key === 'name-desc') return cmpStr(bn, an); if (key === 'climb-desc' || key === 'climb-asc') { @@ -1501,6 +1504,15 @@ if (toggle) toggle.setAttribute('aria-expanded', open ? 'true' : 'false'); } if (toggle) toggle.addEventListener('click', function () { showPanels(!panels.hasAttribute('data-open')); }); + /* The open panels lie over the rows: Show the trails, Escape, or a click outside the form closes them. */ + var done = form.querySelector('.filters__done'); + if (done) done.addEventListener('click', function () { showPanels(false); if (toggle) toggle.focus(); }); + form.addEventListener('keydown', function (e) { + if (e.key === 'Escape' && panels && panels.hasAttribute('data-open')) { showPanels(false); if (toggle) toggle.focus(); } + }); + document.addEventListener('click', function (e) { + if (panels && panels.hasAttribute('data-open') && !form.contains(e.target)) showPanels(false); + }); /* The count is the one live region. Keep it quiet through the first application below so nothing is announced on load, and write to it diff --git a/web/assets/map/outdoor.json b/web/assets/map/outdoor.json index 4103961..597cdfa 100644 --- a/web/assets/map/outdoor.json +++ b/web/assets/map/outdoor.json @@ -17,7 +17,7 @@ "tileSize": 512, "maxzoom": 12, "bounds": [-180, 14, -50, 85], - "attribution": "Relief: Terrain Tiles, USGS and others (full credit below the map)" + "attribution": "Relief: Terrain Tiles, USGS and others (full credit beside the map)" }, "olt-contours": {"type": "vector", "tiles": ["contours://{z}/{x}/{y}"], "minzoom": 11, "maxzoom": 15, "bounds": [-180, 14, -50, 85]} }, diff --git a/web/assets/style.css b/web/assets/style.css index 0922127..4a4197e 100644 --- a/web/assets/style.css +++ b/web/assets/style.css @@ -850,10 +850,10 @@ html.js .map__status:not([data-say]) { display: none; } .map__message > * + * { margin-block-start: var(--space-3); } .map__message h2 { font-size: var(--step-2); } -.mapfig--detail { --map-ratio: 1 / 1; } +.mapfig--detail { --map-ratio: 4 / 3; } @media (min-width: 48rem) { .mapfig { --map-ratio: 2 / 1; } - .mapfig--detail { --map-ratio: 4 / 3; } + .mapfig--detail { --map-ratio: 3 / 2; } } @media (max-width: 40rem) { :root { --collar: 1.25rem; } @@ -964,45 +964,75 @@ html.js .map__status:not([data-say]) { display: none; } .hero__counts { display: grid; gap: var(--space-3); margin-block-start: var(--space-3); } .hero__cta { padding: var(--space-3) var(--space-5); font-size: var(--step-1); } -/* Home: the trails first. The lists, a search bar, then the trails, with the overview map beside - them on a wide screen (it stays in view while the list scrolls). On a narrow screen the map - follows the list, and the bar has a link to it. */ -.home { - display: grid; - gap: var(--space-1) var(--space-6); - grid-template-columns: minmax(0, 1fr); - grid-template-areas: "lists" "bar" "results" "map" "notes"; - align-items: start; +/* Home: the introduction. The headline and its one sentence on the contour ground of the old hero, + at a fraction of its height, and the row of lists under a hairline. */ +.intro { position: relative; overflow: hidden; padding-block: var(--space-6) var(--space-4); } +.intro::before { + content: ""; + position: absolute; + inset-block: 0; + inset-inline: max(0px, (100% - var(--container)) / 2 - var(--gutter)); + background: url("contours.svg") 70% 30% / cover no-repeat; + -webkit-mask-image: radial-gradient(ellipse 60% 120% at 92% 0%, #000 0%, rgb(0 0 0 / 0.6) 30%, rgb(0 0 0 / 0.2) 60%, transparent 85%), linear-gradient(to right, #000 82%, transparent 100%); + mask-image: radial-gradient(ellipse 60% 120% at 92% 0%, #000 0%, rgb(0 0 0 / 0.6) 30%, rgb(0 0 0 / 0.2) 60%, transparent 85%), linear-gradient(to right, #000 82%, transparent 100%); + -webkit-mask-composite: source-in; + mask-composite: intersect; + pointer-events: none; } -.home__lists { grid-area: lists; min-inline-size: 0; } -.home__bar { grid-area: bar; min-inline-size: 0; } -.home__results { grid-area: results; min-inline-size: 0; } -.home__map { grid-area: map; min-inline-size: 0; scroll-margin-block-start: var(--space-4); } -.home__notes { grid-area: notes; } -.finder__notes { display: grid; gap: var(--space-2); } +.intro__inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); } +.intro h1 { max-inline-size: 30ch; font-size: var(--step-3); font-weight: 600; line-height: 1.12; letter-spacing: -0.015em; text-wrap: balance; } +.intro__lede { max-inline-size: 40rem; color: var(--ink-2); font-size: var(--step-1); line-height: 1.45; text-wrap: pretty; } +@media (max-width: 39.99rem) { + .intro { padding-block: var(--space-4) var(--space-3); } + .intro__lede { font-size: var(--step-0); } +} +.home { padding-block: var(--space-4) var(--space-7); } +.finder__notes { display: grid; gap: var(--space-2); margin-block-start: var(--space-6); } .results { container: results / inline-size; } -@media (min-width: 64rem) { - .home { - grid-template-columns: minmax(0, 1fr) 27rem; - grid-template-areas: "lists lists" "bar map" "results map" "notes ."; - } - .home__map { position: sticky; inset-block-start: var(--space-4); } - .home__map .map { aspect-ratio: auto; block-size: clamp(20rem, calc(100dvh - 17rem), 46rem); } - .filters__maplink { display: none; } - .home .results-head { padding-block-end: var(--space-2); } +.home__bar { margin-block-end: var(--space-3); } + +/* Every page that shows a set of trails: the rows, with their map. Wide: the rows on the left, the + map on the right, where it stays in view as the rows scroll. Narrow: the map is a short band above + the rows. The frame takes the shape of the ground it shows (--map-ratio, written on the figure), + no taller than the window allows. Text about the set follows the rows (.browse-about). */ +.browse { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; } +.browse__list, .browse__map { min-inline-size: 0; } +/* The height follows from the column's width and the frame's shape (--frame-n, width over height), + capped by the window; set as a height, not a ratio, so a cap never narrows the frame. */ +.browse__map { container-type: inline-size; scroll-margin-block-start: var(--space-4); } +.browse__map .map { + aspect-ratio: auto; + block-size: clamp(10rem, calc((100cqi - 2 * var(--collar)) / var(--frame-n, 1.5)), 34svh); } -@media (min-width: 64rem) and (pointer: fine) { - .home .results-sort .select { min-block-size: 2.25rem; } - .home .lists-row .chips a { min-block-size: 2rem; } +.browse__map .mapfig__caption { padding-block-start: var(--space-2); font-size: var(--step--2); } +.browse__map .mapfig__caption p { color: var(--ink-3); } +/* On a narrow screen the band keeps its legend; the sentences under it are for the wide layout (and + for screen readers, which still have them). */ +@media (max-width: 55.99rem) { + .browse__map .mapfig__caption p { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } + .browse__map .mapfig__caption { padding-block-start: var(--space-1); } +} +@media (min-width: 56rem) { + .browse { grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.85fr); grid-template-areas: "list map"; gap: var(--space-6); } + .browse__list { grid-area: list; } + .browse__map { grid-area: map; position: sticky; inset-block-start: var(--space-4); } + .browse__map .map { block-size: clamp(16rem, calc((100cqi - 2 * var(--collar)) / var(--frame-n, 1.5)), calc(100svh - 12rem)); } + .browse--no-map { grid-template-columns: minmax(0, 1fr); grid-template-areas: "list"; } + .browse--no-map .browse__list { max-inline-size: 48rem; } +} +@media (min-width: 56rem) and (pointer: fine) { + .browse .results-sort .select { min-block-size: 2.25rem; } .home .filters__bar .input, .home .filters__bar .button { min-block-size: 2.5rem; } } -/* Beside the map the rows are a little closer, so more of the list is in view. */ -@media (min-width: 64rem) { - .home .entry { padding-block: 0.5rem; } -} +.browse--no-map .note { margin-block-start: var(--space-5); max-inline-size: var(--measure); color: var(--ink-2); font: 400 var(--step--1)/1.5 var(--font-sans); } +.browse-about { margin-block-start: var(--space-7); padding-block-start: var(--space-4); border-block-start: 1px solid var(--ink); } +.browse-about > h2 { margin-block-end: var(--space-3); font-size: var(--step-2); } +.browse-about .prose { line-height: 1.55; } +.browse-about .prose > h2 { margin-block-start: var(--space-5); font-size: var(--step-1); } +.browse-about .prose > p { text-wrap: pretty; } -/* The search bar: the search field, a Filters control that opens the panels, Clear (shown only - when something is set), and on a narrow screen a link to the map. */ +/* The search bar: the search field, a Filters control that opens the panels, and Clear (shown only + when something is set). */ .filters__bar { display: flex; align-items: stretch; gap: var(--space-2); } .filters__search { flex: 1 1 auto; min-inline-size: 0; } .filters__bar .button { flex: none; min-block-size: 2.75rem; } @@ -1012,8 +1042,22 @@ html.js .map__status:not([data-say]) { display: none; } .filters__clear[hidden] { display: none; } /* The panels: the existing filter fields, in columns where there is room. With JavaScript they open from the bar; without it the bar and panels are not offered at all (see below). */ +.filters { position: relative; } .filters__panels { margin-block-start: var(--space-2); border: 1px solid var(--ink); background: var(--surface); } html.js .filters__panels:not([data-open]) { display: none; } +/* Open, the panels lie over the rows below the bar, as a sheet laid on the table: the page does not + move, and the map beside them shows what the filters leave. */ +html.js .filters__panels { + position: absolute; + z-index: 30; + inset-inline: 0; + inset-block-start: 100%; + max-block-size: min(72svh, 46rem); + overflow-y: auto; + overscroll-behavior: contain; + box-shadow: 6px 6px 0 var(--rule); +} +.filters__end { position: sticky; inset-block-end: 0; display: flex; justify-content: flex-end; padding: var(--space-3) var(--space-4); border-block-start: 1px solid var(--rule); background: var(--surface); } .filters__panel > summary { display: none; } .filters__more > summary { display: flex; @@ -1434,48 +1478,58 @@ html:not(.js) .list-head__arrow { display: none; } .titleblock--with-plate .titleblock__text > :first-child { grid-column: 2; grid-row: 1; align-self: center; } } -/* Trail page body. The first screen holds the map and the key facts: a short lead and the - buttons, then the map, in the left column; At a glance (and the downloads under it) in the - right one, level with the top of the left. On a narrow screen the order is the buttons, the - facts, the map, the elevation profile and the downloads. The aside is often taller than the - viewport, so it scrolls with the page rather than sticking. */ +/* Trail page body. Directly under the head: the map, the dominant thing, with At a glance beside it, + tops level. Under the map the reading column (the summary and "In brief"); under At a glance the + downloads and the credit. Then, across the page, the elevation profile. The map frame is a calm + landscape of the same shape on every trail page, the track fitted inside it; never taller than + the window. On a narrow screen: a strip of the key facts, the map, the facts, the words, the + downloads, the profile. */ .detail { display: grid; - gap: var(--space-4) var(--space-6); + gap: var(--space-5) var(--space-6); grid-template-columns: minmax(0, 1fr); - grid-template-areas: "lead" "glance" "map" "aside"; + grid-template-areas: "strip" "map" "glance" "text" "aside" "profile"; align-items: start; - padding-block-start: var(--space-3); + padding-block-start: var(--space-4); } -.detail--with-profile { grid-template-areas: "lead" "glance" "map" "profile" "aside"; } -.detail__lead { grid-area: lead; display: grid; gap: var(--space-3); min-inline-size: 0; } -.detail__lead:not(:has(*)) { display: none; } +.trail-strip { grid-area: strip; } +.detail__map { grid-area: map; min-inline-size: 0; } .detail__side { display: contents; } .detail__glance { grid-area: glance; min-inline-size: 0; } -.detail__map { grid-area: map; min-inline-size: 0; } -.detail__profile { grid-area: profile; min-inline-size: 0; } -.detail__main { min-inline-size: 0; } .detail__aside { grid-area: aside; min-inline-size: 0; } .detail__aside > * + * { margin-block-start: var(--space-5); } +.detail__text { grid-area: text; min-inline-size: 0; } +.detail__profile { grid-area: profile; min-inline-size: 0; } +.detail__main { min-inline-size: 0; } +/* With no track the frame holds a notice: as tall as the notice needs, and never less than a calm frame. */ +.detail .map--empty { min-block-size: 18rem; } +@media (min-width: 64rem) { .detail .map--empty { min-block-size: 26rem; } } @media (min-width: 64rem) { .detail { grid-template-columns: minmax(0, 1fr) 22rem; - grid-template-rows: auto 1fr; - grid-template-areas: "lead side" "map side"; + grid-template-rows: auto 1fr auto; + grid-template-areas: "map side" "text side" "profile profile"; + row-gap: var(--space-6); } - .detail--with-profile { grid-template-rows: auto 1fr auto; grid-template-areas: "lead side" "map side" "profile profile"; } - .detail__lead:not(:has(*)) { display: block; } + .trail-strip { display: none; } .detail__side { display: grid; grid-area: side; gap: var(--space-5); align-content: start; min-inline-size: 0; } .detail__side > * { grid-area: auto; } - /* The map is as tall as the window allows, and stays in view while the facts and downloads - beside it scroll past. */ - .detail__map { align-self: start; position: sticky; inset-block-start: var(--space-4); } - .detail__map .map { aspect-ratio: auto; block-size: clamp(30rem, calc(100dvh - 15rem), 52rem); } - /* With no track there is no map: the notice keeps its own height. */ - .detail--no-map .detail__map { position: static; } - .detail--no-map .detail__map .map { block-size: auto; min-block-size: 22rem; } } +/* The key facts in one line on a phone: length, time and where. */ +.trail-strip { + display: flex; + flex-wrap: wrap; + gap: var(--space-1) var(--space-5); + padding-block: var(--space-2); + border-block: 1px solid var(--ink); + font: 400 var(--step--1)/1.35 var(--font-sans); +} +.trail-strip dt { color: var(--ink-2); font: 600 var(--step--2)/1.3 var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; } +.trail-strip dd { margin: 0; font-weight: 500; } +.trail-strip div:first-child dd { font-weight: 600; } +@media (min-width: 64rem) { .trail-strip { display: none; } } + .block + .block { margin-block-start: var(--space-7); } .block > h2 { display: flex; @@ -1856,11 +1910,13 @@ td .linklist a { font-weight: 400; } .rawrecord[open] > summary::after { transform: translateY(25%) rotate(-135deg); } .rawrecord > summary:focus-visible { outline-offset: -5px; } .rawrecord > .note { padding: 0 var(--space-4) var(--space-3); } -.rawrecord .table-wrap { border: 0; border-block-start: 1px solid var(--rule); } -.rawrecord__table { table-layout: fixed; } -.rawrecord__table thead th:first-child { inline-size: 34%; } -.rawrecord__table th, .rawrecord__table td { overflow-wrap: anywhere; } -.rawrecord__table td { font-family: var(--font-mono); font-size: var(--step--1); } +/* Each field and its value: the field's name on the left, its value beside it, a hairline between. */ +.rawrecord__fields { margin: 0; border-block-start: 1px solid var(--rule); font: 400 var(--step--1)/1.45 var(--font-sans); } +.rawrecord__fields > div { display: grid; grid-template-columns: minmax(0, 34%) minmax(0, 1fr); gap: var(--space-1) var(--space-4); padding: var(--space-2) var(--space-4); border-block-end: 1px solid var(--rule); } +.rawrecord__fields > div:last-child { border-block-end: 0; } +.rawrecord__fields dt, .rawrecord__fields dd { margin: 0; overflow-wrap: anywhere; } +.rawrecord__fields dd { font-family: var(--font-mono); } +@media (max-width: 40rem) { .rawrecord__fields > div { grid-template-columns: minmax(0, 1fr); } } /* 404 page search */ .notfound-search { @@ -1880,7 +1936,9 @@ td .linklist a { font-weight: 400; } on the first screen (the map and the facts of a trail, the first trails of a list). */ .page-head { padding-block: var(--space-3) 0; } .page-head .titleblock { margin-block: var(--space-2) 0; gap: var(--space-2) var(--space-4); } -.page-head .titleblock h1 { font-size: var(--step-3); line-height: 1.1; } +.page-head .titleblock h1 { font-size: var(--step-3); line-height: 1.1; text-wrap: balance; } +/* A long name is set a step smaller, so it keeps to two or three lines. */ +.page-head .titleblock--long h1 { font-size: var(--step-2); line-height: 1.15; } .page-head .titleblock--with-plate { grid-template-columns: 4.5rem minmax(0, 1fr); } .page-head .titleblock .plate { padding: 0.35rem; } .page-head .titleblock__text { gap: var(--space-1); } @@ -1888,23 +1946,36 @@ td .linklist a { font-weight: 400; } @media (min-width: 48rem) { .page-head .titleblock--with-plate { grid-template-columns: 6rem minmax(0, 1fr); } } -/* The lead above the map: the first sentence of the summary, when it is short. The summary in - full is under the map. */ -.trail-lede { max-inline-size: 46rem; font-size: var(--step-0); line-height: 1.45; text-wrap: pretty; } -.trail-actions { margin-block-start: 0; } -/* On a phone the buttons come first. */ -@media (max-width: 47.99rem) { - .detail__lead { display: flex; flex-direction: column; } - .detail__lead .trail-actions { order: -1; } +/* The head of a trail page: the name on the left; the actions at the right on a wide screen, as wide + as the column of facts under them and level with the foot of the name; on a narrow one, a row + under the name. */ +.trail-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--space-6); } +.trail-head > .breadcrumb { grid-column: 1 / -1; } +.trail-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-block-start: var(--space-3); } +.trail-actions .button { min-block-size: 2.5rem; } +@media (min-width: 64rem) { + .trail-head { grid-template-columns: minmax(0, 1fr) 22rem; align-items: end; } + .trail-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin-block-start: 0; } + .trail-actions .button { justify-content: center; } + .trail-actions__gpx { grid-column: 1 / -1; } } -/* Under the map: the summary in full, the generated "In brief" paragraph, the date of the last - check, and the other pages about the trail. */ -.trail-text { max-inline-size: 46rem; margin-block-end: var(--space-6); } -.trail-text > h2 { margin-block-end: var(--space-3); font-size: var(--step-2); } +@media (max-width: 39.99rem) { + .trail-actions { flex-wrap: nowrap; } + .trail-actions .button { flex: 0 1 auto; min-inline-size: 0; padding-inline: var(--space-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } + .trail-actions .trail-actions__gpx { flex: 1 1 auto; } +} +/* Under the map: the summary in full, the "In brief" paragraph, the date of the last check (small + print), and the other pages about the trail. */ +.trail-text { max-inline-size: 42rem; } .trail-summary { font-size: var(--step-1); line-height: 1.5; text-wrap: pretty; } -.trail-brief { margin-block-start: var(--space-3); line-height: 1.55; text-wrap: pretty; } -.trail-checked { margin-block-start: var(--space-3); } -.trail-more .morelinks { max-inline-size: 46rem; margin-block-end: var(--space-6); } +.trail-brief { margin-block-start: var(--space-4); line-height: 1.6; text-wrap: pretty; } +.trail-checked { margin-block-start: var(--space-3); color: var(--ink-3); font: 400 var(--step--2)/1.4 var(--font-sans); letter-spacing: 0.02em; } +.detail__text .morelinks { max-inline-size: 42rem; margin-block-start: var(--space-6); } +/* The map's credit, small print under the downloads. */ +.map-credit { color: var(--ink-2); font: 400 var(--step--2)/1.5 var(--font-sans); } +.map-credit > * + * { margin-block-start: var(--space-2); } +.map-credit__title { color: var(--ink-2); font: 600 var(--step--2)/1.3 var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; } +.map-credit a { overflow-wrap: anywhere; } /* At a glance: the hiker's facts, a legend box like the panels */ .glance { border: 1px solid var(--ink); background: var(--surface); } @@ -1927,6 +1998,13 @@ td .linklist a { font-weight: 400; } .glance__facts > div:first-child, .glance__facts > div:nth-child(2):not(.glance__wide) { border-block-start: 0; } .glance__wide { grid-column: 1 / -1; } +.glance__facts > .glance__wide:first-child + div { border-block-start: 1px dotted var(--rule-strong); } +.glance__facts > .glance__wide:first-child + div:not(.glance__wide) + div:not(.glance__wide) { border-block-start: 1px dotted var(--rule-strong); } +/* The length leads, large; a built or whole-system figure is one quiet line each under it. */ +.glance__length { --len-size: var(--step-3); } +.glance__length .len--stack { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); } +.glance dd .glance__aside { display: block; margin-block-start: var(--space-1); } +.glance__length small { margin-block-start: var(--space-2); } .glance dt { color: var(--ink-2); font: 600 var(--step--2)/1.3 var(--font-sans); @@ -2099,21 +2177,31 @@ td .linklist a { font-weight: 400; } .hero--short { padding-block: var(--space-3) var(--space-2); } .hero--short .hero__inner { gap: var(--space-1); } -/* The home page's lists: a short row. The label leads it, and the pills fit one row or two on a - wide screen; on a phone they are one row that scrolls sideways within itself. */ -.lists-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); } -.lists-row__title { font: 600 var(--step--2)/1.3 var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); } -.lists-row .chips { flex: 1 1 0; min-inline-size: 0; } -@media (min-width: 40rem) and (pointer: fine) { .lists-row .chips a { min-block-size: 2.25rem; } } +/* The home page's lists: one quiet line of links under the headline, each with its count, ending in + All lists. On a phone it is one line that scrolls sideways within itself. */ +.lists-row { margin-block-start: var(--space-2); padding-block-start: var(--space-3); border-block-start: 1px solid var(--rule); } +/* Each link carries its dot in its own left padding, and the line is pulled left by that padding and + clipped, so a link that starts a line shows no dot (as the facts line of a row does). */ +.lists-row ul { + display: flex; flex-wrap: wrap; align-items: center; + margin-inline-start: -0.8em; clip-path: inset(0 0 0 0.8em); + padding: 0; list-style: none; font: 500 0.8rem/1.3 var(--font-sans); +} +.lists-row li { position: relative; display: inline-flex; align-items: center; padding-inline-start: 0.8em; } +.lists-row li::before { content: "\00B7"; position: absolute; inset-inline-start: 0.26em; color: var(--ink-3); } +.lists-row a { display: inline-flex; align-items: center; min-block-size: 2rem; color: var(--ink); text-decoration-color: var(--rule-strong); } +.lists-row a:hover { text-decoration-color: var(--trail); } +.lists-row__n { display: inline-block; margin-inline-start: 0.35em; color: var(--ink-2); font-variant-numeric: tabular-nums; } +.lists-row__all a { color: var(--link); font-weight: 600; } @media (max-width: 39.99rem) { - .lists-row { display: grid; gap: var(--space-1); } - .lists-row .chips { - flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; - margin-inline: calc(-1 * var(--gutter)); padding: 3px var(--gutter); + .lists-row ul { + flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; clip-path: none; + margin-inline: calc(-1 * var(--gutter)); padding-inline: calc(var(--gutter) - 0.8em) var(--gutter); } - /* The row scrolls by touch; a scrollbar under it reads as a stray white band */ - .lists-row .chips::-webkit-scrollbar { display: none; } - .lists-row .chips li { flex: none; } + .lists-row li:first-child::before { visibility: hidden; } + .lists-row ul::-webkit-scrollbar { display: none; } + .lists-row li { flex: none; } + .lists-row a { min-block-size: 2.75rem; } } .section--finder { padding-block-start: var(--space-4); } .pills { display: flex; flex-wrap: wrap; gap: var(--space-2); } @@ -2159,21 +2247,6 @@ a.tag:hover { background: var(--sunken); } .page-head .chips { margin-block-start: var(--space-2); } .place > * + * { margin-block-start: var(--space-6); } .section.place { padding-block-start: var(--space-4); } -/* A place, list or routes page: the list, then the map, then the page's own text; on a wide - screen the list beside the text and the map, which stays in view as the list scrolls. */ -.place-grid { - display: grid; align-items: start; gap: var(--space-5) var(--space-6); - grid-template-columns: minmax(0, 1fr); grid-template-areas: "list" "map" "text"; -} -.place-grid__text { grid-area: text; min-inline-size: 0; } -.place-grid__list { grid-area: list; min-inline-size: 0; } -.place-grid__map { grid-area: map; min-inline-size: 0; } -@media (min-width: 64rem) { - .place-grid { grid-template-columns: minmax(0, 1fr) 27rem; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "list text" "list map"; gap: var(--space-4) var(--space-6); } - .place-grid__map { position: sticky; inset-block-start: var(--space-4); } - .place-grid__map .map { aspect-ratio: auto; block-size: clamp(18rem, calc(100dvh - 17rem), 40rem); } -} - /* About hub */ .about-hub__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 0 var(--space-5); max-inline-size: none; } .about-hub__list li, .about-hub__list li:first-child { padding-block: var(--space-2); border-block-start: 0; border-block-end: 1px dotted var(--rule-strong); } @@ -2232,6 +2305,11 @@ a.tag:hover { background: var(--sunken); } .entry__facts .line__status { display: inline; font: inherit; } .entry__guides { grid-column: 2 / -1; grid-template-columns: minmax(0, 1fr); } } +/* A figure that leads a row's facts (a ranking's figure, with its rank) is set as the length is; the + facts a page adds for comparing a few trails keep their labels. */ +.entry__rank { color: var(--trail); font-weight: 600; font-variant-numeric: tabular-nums; } +.entry__figure { font-weight: 600; } +.entry__more dt { position: static !important; inline-size: auto !important; block-size: auto !important; overflow: visible !important; clip-path: none !important; margin-inline-end: 0.35em; color: var(--ink-2); font: inherit; letter-spacing: 0; text-transform: none; } /* A wider card has room for a larger logo. */ @container results (min-width: 34rem) and (max-width: 65.99rem) { .entry { --plate-w: 6rem; gap: var(--space-2) var(--space-4); } @@ -2325,3 +2403,30 @@ html:not(.js) .saved-body { display: none; } .shelf--author { grid-template-rows: auto 1fr auto; padding: var(--space-4); } .shelf--author .shelf__items, .shelf--author .shelf__more { display: block; } } + +/* 14. Rows of things that are not trails ------------------------------------ */ + +/* Files, terms, changes, places and the trails left out are set as a trail's row is, with no emblem: + a name, its sentence, a line of short facts and small print (olt/pagekit.py plain_entry). */ +.entries .entry--plain { grid-template-columns: minmax(0, 1fr); grid-template-areas: "body"; padding: var(--space-3) 0; } +.entry--plain .entry__name { font-size: var(--step-0); } +.entry--plain .entry__desc { display: block; -webkit-line-clamp: none; line-clamp: none; overflow: visible; max-inline-size: var(--measure); font-size: var(--step--1); } +.entry__meta { + display: flex; flex-wrap: wrap; align-items: baseline; + margin-inline-start: -1.1em; clip-path: inset(0 0 0 1.1em); + color: var(--ink); font: 400 var(--step--1)/1.5 var(--font-sans); +} +.entry__meta > span { position: relative; padding-inline-start: 1.1em; } +.entry__meta > span::before { content: "\00B7"; position: absolute; inset-inline-start: 0.4em; color: var(--ink-2); } +.entry__meta > span:first-child { font-weight: 600; } +.entry__label { color: var(--ink-2); font-weight: 400; } +.entry__small { color: var(--ink-3); font: 400 var(--step--2)/1.45 var(--font-sans); letter-spacing: 0.02em; } +.entry__small a { color: var(--link); } +.prose .entries--plain { margin-block-start: var(--space-3); } +.results__n { color: var(--ink-2); font: 500 var(--step--1)/1 var(--font-sans); } +.results__group a { color: var(--ink); text-decoration-color: var(--rule-strong); } +.results--short .entries { margin-block-start: var(--space-3); } +.numbers > section + section, .left-out > section + section { margin-block-start: var(--space-7); } +.numbers > section > h2 { margin-block-end: var(--space-3); font-size: var(--step-2); } +.numbers > section > ul { padding-inline-start: 1.2em; } +.left-out > section { margin-block-start: var(--space-7); } diff --git a/web/olt/authors.py b/web/olt/authors.py index 3ae6ebe..cfebd2a 100644 --- a/web/olt/authors.py +++ b/web/olt/authors.py @@ -152,33 +152,27 @@ def index_page(records, site, repo_root): top = prominent(gs) rest = [g for g in gs if g not in top] n_gpx = sum(1 for r in routes if facets.gpx_here(r)) - lede = (f"{len(routes)} long hiking routes, worked out by {len(gs)} authors. " - f"Every author has a page of their own, with their routes and where each is published. " - f"{n_gpx} of the routes {'has' if n_gpx == 1 else 'have'} a GPX here. {esc(facets.ROUTE_DEFINITION)}") - sections = "" - if top: - blocks = "\n".join(_block(g) for g in top) - sections += (f'
{_plural(len(top), "author")}, the most routes first.
\n' - f'Every author has a page with their routes and where each is published. " + f"{n_gpx} of the routes {'has' if n_gpx == 1 else 'have'} a GPX here. {esc(facets.ROUTE_DEFINITION)}
") + # The authors with the most routes lead the page: each under their own heading, their routes as + # the site's rows, with every route on the map beside them. The other authors follow as a list. + groups = [(f'{esc(g["name"])} {_plural(len(g["routes"]), "route")}', + g["routes"], regions.route_guides) for g in top] + rest_html = "" if rest: items = "\n".join(f'{_plural(len(top), 'author')} with {PROMINENT_MIN} or more routes are above, the most routes first. " + "A route credited to several people is listed under each of them. An author credited in more than one form is " + "listed once, under the name authors.toml gives. Guides marked free are free; the rest are bought from the " + "author or publisher.
") body = (pagekit.head("Route authors", lede, [("Trails", "/"), ("Lists", "/lists/"), ("Routes", "/routes/")]) + f"""A route credited to several people is listed under each of them. An author credited in more than one form is - listed once, under the name authors.toml gives. Guides marked free are free; the rest are bought from the author or publisher.
+' + " ".join(lines) + "
" - briefs = "".join(f'" + " ".join(lines) + "
" + briefs = "".join(f'{tag_html}
' if tag_html else "" - by = f'\n{esc(facets.route_by(rec))}
' if route and not routes_list else "" + by = f'\n{route_by_html(rec)}
' if route and not routes_list else "" desc = entry_desc(rec) desc_html = f'\n{esc(desc)}
' if desc else "" time_html = esc(facets.time_text(rec)) + (' estimate' if est else "") @@ -175,6 +199,14 @@ def entry(rec, *, level=3, extra="", routes_list=False, hidden=False, eager=Fals f'computed') if climb_m is not None else "" if hidden: attrs += " hidden" + lead_html = "" + if rank is not None: + attrs += f' data-rank="{rank}"' + if lead: + no = f'No. {rank} ' if rank is not None else "" + lead_html = (f'\n{where_html(rec)}
{total} {noun}
' empty = "" - tools = sort_select(default_sort, saved=saved) - dflt = SAVED_ORDER[0] if saved else default_sort + if not tools: + return Markup(f'{lede}
+ listing = f""" + {results(recs, finder=True)}""" + return f"""{lede}
+ {lists_row(records, picks)}Not for navigation: tracks vary in quality and some trails are unfinished. Check each trail’s own maps before you go.
{contribute}| {esc(e.get("name", ""))}{mark} | ' - f'{esc(_where(e))} | ' - f'{_length(e)} | ' - f'{why} | ' - f'" - f' | {source} |
| Trail | Where | Length | Why it is left out | Decided | Source |
|---|
Trails and routes that were looked at for this dataset and left out, and why.
{_opening(entries, site)}
{groups}{tag}
' if tag else "" + h = f"h{level}" if heading else "p" + paras = "".join(f'{t}
' for t in text if str(t).strip()) + line = "".join(f'{f}' for f in facts if str(f).strip()) + line = f'' if line else "" + fine = " · ".join(str(x) for x in small if str(x).strip()) + fine = f'{fine}
' if fine else "" + return (f'{_plural(len(across))} that {"crosses" if len(across) == 1 else "cross"} the whole country rather than one province: {links}. @@ -109,34 +109,13 @@ def regions_index_page(records, site):
The {len(records)} trails by state and province, grouped into parts of the United States ({n_us}) and Canada ({n_ca}). A trail that crosses several states is on each one’s page.
-" + " ".join(parts) + "
") - - def region_page(slug, records, site, facet_pages=()): """(title, description, body, needs_map) for /regions/Every other trail on this site is an official trail. Being a route says who looks after it, not + intro = f"""
Every other trail on this site is an official trail. Being a route says who looks after it, not how rough it is: some routes are on maintained trail all the way, and some official trails have long road walks. The Walking line on each trail’s page says what the walking is.
-{_plural(len(routes), "route")}, by {len(by_author)} authors. {n_gpx} {"has" if n_gpx == 1 else "have"} a GPX here; for the rest, +
{_plural(len(routes), "route")}, by {n_authors or len(by_author)} authors. {n_gpx} {"has" if n_gpx == 1 else "have"} a GPX here; for the rest, each route’s page says whether its author gives the track away, sells it, or does not publish it. - Narrow them with the filters.
-{_plural(len(routes), "route")} by {_plural(n_authors, "author")}
' + if n_authors else "") body = f"""A list
{esc(facets.ROUTE_DEFINITION)}
+{esc(facets.ROUTE_DEFINITION)}
{head_count}A list
{esc(lst.blurb)} {_plural(len(recs))}, {n_gpx} with a GPX here.{note}
+{esc(lst.blurb)} {_plural(len(recs))}, {n_gpx} with a GPX here.
{esc(note.strip())}
' if note else ''}{rule}
", + about_title="About this list")} {after} -{rule}
{intro}
{esc(figures_note(recs))}
' - - # Collections ---------------------------------------------------------------------- def collection_members(collection, records): @@ -114,44 +90,41 @@ def collection_page(collection, records, site): total_mi = sum(r["derived"]["length_mi"] for r in recs) total_km = sum(r["length_km"] for r in recs) places = {c for r in recs for c in r.get("regions", [])} - lede = (f"{esc(collection['definition'])} Here are the {len(recs)} trails side by side, in the order the " - f"definition names them, from what each trail's page says. Their published lengths add up to {words.fmt_int(total_mi)} " - f"miles ({words.fmt_int(total_km)} km), across {len(places)} states and provinces.") - headers = ["Figure"] + [common.plain_name(r) for r in recs] - rows = [[label] + [fn(r) for r in recs] for label, fn in FIGURES] - rows.insert(0, ["Full name"] + [pagekit.trail_link(r) for r in recs]) - rows.append(["Designated"] + [common.designated_year(r) or "Not on file" for r in recs]) - source = (f'The award is described by {esc(collection.get("source_publisher", "its holder"))} at ' + lede = esc(collection['definition']) + totals = (f"
Their published lengths add up to {words.fmt_int(total_mi)} miles ({words.fmt_int(total_km)} km), " + f"across {len(places)} states and provinces.
") + source = (f'The award is described by {esc(collection.get("source_publisher", "its holder"))} at ' f'{esc(collection["source_url"])}. ' f'{esc(figures_note(recs))} Lengths are the published figures. ' f'See the method for how they are checked.
') from . import home + + def more(r): + """The figures the trails are compared by, beyond a row's own: high point, climb, year named.""" + out = [] + hp_name, hp_m = high_point(r) + if hp_m is not None: + out.append(("High point", Markup(f"{esc(hp_name + ', ') if hp_name else ''}{words.elevation(hp_m)}"))) + climb = facets.row_climb_m(r) + if climb is not None: + out.append(("Climb", words.elevation(climb))) + year = common.designated_year(r) + if year: + out.append(("Designated", esc(str(year)))) + return out body = (pagekit.head(f"{name} trails compared", lede, [("Trails", "/"), ("Lists", "/lists/")]) + '{esc(caveat)}
Where two trails share a figure, they are in name order. " + f"The same figures are on each trail’s page. See the method for what the caveats mean.
") body = (pagekit.head(head, lede, [("Trails", "/"), ("Lists", "/lists/"), ("By the numbers", NUMBERS)]) + 'Where two trails share a figure, they are in name order. ' - f'The same figures are on each trail’s page. See the method for what the caveats mean.
' - f'A trail that crosses several states is counted in each, so the counts add up to more than {len(records)}.
- {pagekit.table(["Place", "Trails", "Routes", "Loops", "With a GPX", "Longest"], place_rows, caption="Trails by state and province", numeric=(1, 2, 3, 4))}Lengths are the published figures, which are check values, not measured from a track. See the method. The longest trails and the shortest have their own lists.
diff --git a/web/olt/summary.py b/web/olt/summary.py index e6e00bf..0426216 100644 --- a/web/olt/summary.py +++ b/web/olt/summary.py @@ -1,7 +1,7 @@ """A paragraph built from the records that a page lists: what the set holds. - facts(recs, records) count, longest and shortest, loops and routes, times, terrain, - holders, highest point, and how many have a GPX + facts(recs, records) one short paragraph: the longest and shortest, loops and routes, + the most common terrain and the highest point Every figure is counted from the records, and a sentence is left out when the records give it nothing to say. No trail is named here: the longest and the shortest are found @@ -57,51 +57,40 @@ def holder_counts(recs, records): def facts(recs, records): - """The summary paragraphs (Markup) for a set of trails. Empty for no trails.""" + """The summary of a set of trails: one short paragraph (Markup). Empty for no trails.""" if not recs: return Markup("") by_length = sorted(recs, key=lambda r: (r["length_km"], r["id"])) shortest, longest = by_length[0], by_length[-1] sentences = [] if len(recs) > 1: - sentences.append(f"The longest is {_name_link(longest)}, {_miles(longest)}. " - f"The shortest is {_name_link(shortest)}, {_miles(shortest)}.") + sentences.append(f"The longest is {_name_link(longest)}, {_miles(longest)}, " + f"and the shortest {_name_link(shortest)}, {_miles(shortest)}.") else: sentences.append(f"{_name_link(longest)} is {_miles(longest)} long.") loops = sum(1 for r in recs if facets.shape(r) == "loop") routes = [r for r in recs if facets.kind(r) == "route"] parts = [] if loops: - parts.append(_plural(loops, "loop")) + parts.append(f"{loops} {'is a loop' if loops == 1 else 'are loops'}") if routes: authors = {facets.author(r) for r in routes if facets.author(r)} - parts.append(f"{_plural(len(routes), 'route')}" + (f" by {_plural(len(authors), 'author')}" if authors else "")) + n = len(routes) + parts.append(f"{n} {'is a route' if n == 1 else 'are routes'}" + + (f" by {_plural(len(authors), 'author')}" if authors and n > 1 else "")) if parts and len(recs) > 1: - sentences.append(f"{_join(parts)[:1].upper()}{_join(parts)[1:]}.") - paragraphs = [" ".join(sentences)] - - more = [] - timed = sorted(recs, key=lambda r: facets.time_days(r)[:2]) - if len(recs) > 1: - quick, slow = timed[0], timed[-1] - more.append(f"The quickest to walk whole is {_name_link(quick)}, {facets.time_text(quick).lower()}, " - f"and the slowest is {_name_link(slow)}, {facets.time_text(slow).lower()}.") + text = _join(parts) + sentences.append(f"{text[:1].upper()}{text[1:]}.") terrain = terrain_counts(recs) - if terrain: + if terrain and len(recs) > 1: shown = _join( - f'{_list_link(records, "terrain-" + t, words.TERRAIN[t].lower(), n)}' for t, n in terrain[:4]) - have = sum(1 for r in recs if facets.terrain(r)) - more.append(f"Terrain is on file for {have} of them; the most common is {shown}.") - holders = holder_counts(recs, records) - if holders: - more.append("By designation: " + _join(_list_link(records, lst.key, lst.title, k) for lst, k in holders) + ".") + f'{_list_link(records, "terrain-" + t, words.TERRAIN[t].lower(), n)}' for t, n in terrain[:3]) + sentences.append(f"The most common terrain is {shown}.") high = [(hike.table(r).get("high_point_m"), r) for r in recs if isinstance(hike.table(r).get("high_point_m"), (int, float))] if high: m, top = max(high, key=lambda t: (t[0], t[1]["id"])) - more.append(f"The highest point stated is {words.elevation(m)}, on {_name_link(top)}.") - if more: - paragraphs.append(" ".join(more)) - return Markup("".join(f"{p}
" for p in paragraphs)) + sentences.append(f"The highest point on file is {words.elevation(m)}, on {_name_link(top)}.") + return Markup(f"{' '.join(sentences)}
") DETAIL_MAX = 3 # a page with this many trails or fewer gets a paragraph on each, so it is not a bare list diff --git a/web/olt/trail.py b/web/olt/trail.py index e67a21c..ea707bc 100644 --- a/web/olt/trail.py +++ b/web/olt/trail.py @@ -128,6 +128,16 @@ def lead_line(rec): return rec.get("designation", "") +def credit_html(rec, credit, author_links=None): + """A route's credit as HTML, each author's name in it a link to their page (olt/authors.py link_map).""" + text = str(esc(credit)) + for name, href in (author_links or {}).get(facets.author(rec), []): + n = str(esc(name)) + if n in text: + text = text.replace(n, f'{n}', 1) + return Markup(text) + + def lead_html(rec, lead, author_links=None): """The lead line as HTML; on a route, the author's name in it links to the author's page (author_links: {credit: [(name, path)]} from olt/authors.py).""" @@ -384,6 +394,10 @@ def checked_line(rec): return Markup(f'Last checked
') +# A name longer than this (in characters) is set a step smaller in the page's head. +LONG_NAME = 48 + + def page_head(rec, author_links=None): route = common.is_route(rec) crumbs = ['{tag_html}
' if tag_html else "" lead = lead_line(rec) define = route_definition() if route else "" + # The actions belong to the head: on a wide screen they stand at its right, over the column of + # facts; on a narrow one they are one row under the name (style.css .trail-head). return f"""{common.rich(one)}
') - - def action_buttons(rec): - """The buttons under the lead: the trail's own page, the GPX, Save.""" + """The trail's actions, in its head: the GPX (or where to get it), the trail's own page, Save.""" actions = [] + if rec["derived"].get("downloads"): + actions.append(f'{common.ICON_DOWNLOAD}Download the GPX') + else: + actions.append(f'GPX: {esc(facets.GPX_STATUS[facets.gpx(rec)])}') official = official_link(rec) if official: actions.append(f'{esc(official[1])} {common.ICON_EXTERNAL}') @@ -449,23 +456,30 @@ def action_buttons(rec): first = more_links(rec)[0] actions.append(f'' f'{esc(first["publisher"])} {common.ICON_EXTERNAL}') - if rec["derived"].get("downloads"): - actions.append(f'{common.ICON_DOWNLOAD}Download the GPX') - else: - actions.append(f'GPX: {esc(facets.GPX_STATUS[facets.gpx(rec)])}') actions.append(str(common.save_button(rec, row=False))) - return f'{"".join(actions)}
' + return f'{"".join(actions)}
' + + +def strip(rec): + """The key facts in one tight line, for a phone: length, time and where (style.css shows it there + only; At a glance has the same facts in full).""" + codes = " ".join(esc(c.split("-")[-1]) for c in rec.get("regions", [])) + return f"""{lede}
- {brief(rec, label=False)} + {brief(rec)} {checked_line(rec)}Know before you go. {common.rich(common.sentence(h["caution"]))}
' @@ -653,11 +672,27 @@ def map_figure(rec):Track: {esc(src.get("line_source", ""))}, read {esc(src.get("source_checked", ""))}, drawn simplified to 30 m. Credit: {esc(credit)} {common.TRAIL_MAP_CREDIT}
+Track: {esc(src.get("line_source", ""))}, read {esc(src.get("source_checked", ""))}, drawn simplified to 30 m.
Track credit: {esc(credit)}
" + return f"""{common.TRAIL_MAP_CREDIT}
+{reason_html}
{esc(rule)}
{actions_html} -{common.TRAIL_MAP_CREDIT}
{esc(r["creator_words"])}
{esc(by)} {not_creator}
+{esc(by) if r.get("creator_words_by") else credit_html(rec, by, author_links)} {not_creator}
{f'Read on {ext_link(url)}.
' if url else ""}{esc(field)}{esc(field)}As stored in trail.toml. The record schema says what each field means.
-| Field | Value |
|---|
Each trail keeps its own history, shown at the foot of its page. The - changelog lists changes to the site and the dataset as a whole.
(.*?)
') + home = read_out("index.html") + by_line = {m for m in row.findall(home)} + for r in routes: + for name, href in links.get(r["route"]["creator"], []): + self.assertIn(f'{_html.escape(name)}', "".join(by_line), r["id"]) + # a credit with two people links each; a credit with no page stays plain + self.assertTrue(any(len(v) > 1 for v in links.values())) + self.assertEqual(len(gs), len({n for v in links.values() for n, _ in v})) + # Routes page head + page = read_out("routes/index.html") + head = page[:page.index('{len(routes)} routes by {len(gs)} authors
', head) + # Lists index: in the group Routes is in + lists = read_out("lists/index.html") + group = lists[lists.index('id="group-standing"'):] + group = group[:group.index("")] + self.assertIn('Routes', group) + self.assertIn('Route authors', group) + # the trail page links the author's name in its head and its Author fact + for r in routes: + for name, href in links.get(r["route"]["creator"], []): + trail_page = read_out(f"trails/{r['id']}/index.html") + self.assertGreaterEqual(trail_page.count(f''), 2, r["id"]) + def test_every_logo_on_logos_page(self): page = read_out("logos/index.html") for r in self.records: @@ -185,9 +219,9 @@ class ExtraPagesTest(unittest.TestCase): # no dataset filters for name in ("tier", "policy", "designated", "line", "country", "region"): self.assertNotIn(f'name="{name}"', form, name) - # the map is in the tool, beside the list it filters (after it in the page, beside it on a wide screen) - main = doc[doc.index('None (no track included)
', page) self.assertNotIn("none (no line included)", page) - self.assertEqual(page.count('