Make four list titles say what their lists hold: the longest list names the US and Canada, the week list says a week or less, the weekend list says a long weekend because every trail in it takes 3 or 4 days, and the cross-country list says its trails have cross-country stretches, since 38 of its 54 are not mostly cross-country
This commit is contained in:
1 parent
e3cb071968
commit
6ce23ff2bb
3 files changed
+13
-15
No files matched your search
+6
-6
@@ -195,7 +195,7 @@ LISTS = (
|
||||
List("longest", "The longest hiking trails",
|
||||
f"Trails of {LONG_MI:,} miles ({_km(LONG_MI)} km) or more.",
|
||||
lambda r: r["length_km"] >= LONG_KM, sort="length-desc",
|
||||
page_title=f"Longest Hiking Trails in the US: {{n}} Trails of {LONG_MI:,}+ Miles", group="length",
|
||||
page_title=f"Longest Hiking Trails in the US and Canada: {{n}} Trails", group="length",
|
||||
lede=longest_lede),
|
||||
List("500-to-1000-miles", f"{HALF_MI} to {LONG_MI:,} miles",
|
||||
f"Trails of {HALF_MI} miles ({_km(HALF_MI)} km) or more and shorter than {LONG_MI:,} miles ({_km(LONG_MI)} km).",
|
||||
@@ -228,11 +228,11 @@ LISTS = (
|
||||
List("weekend", "A weekend or long weekend",
|
||||
f"Backpacking trips of {WEEKEND_DAYS} days or fewer: trails that take that long to walk whole.",
|
||||
lambda r: _mid_days(r) <= WEEKEND_DAYS, sort="time-asc",
|
||||
page_title="Weekend Backpacking Trips: {n} Long Trails", group="time", note=time_note),
|
||||
page_title="Long-Weekend Backpacking Trips: {n} Long Trails", group="time", note=time_note),
|
||||
List("a-week-or-less", "A week or less",
|
||||
"Week-long backpacking trips: trails most people walk in a week or less, as a source states it or as estimated from the length.",
|
||||
_band("week"), sort="time-asc", page_title="Week-Long Backpacking Trips: {n} Long Trails",
|
||||
group="time", note=time_note, noun="Week-Long Backpacking Trips", short="Week-Long Trips"),
|
||||
"Backpacking trips of a week or less: trails most people walk in a week or less, as a source states it or as estimated from the length.",
|
||||
_band("week"), sort="time-asc", page_title="Backpacking Trips of a Week or Less: {n} Long Trails",
|
||||
group="time", note=time_note, noun="Backpacking Trips of a Week or Less", short="Trips of a Week or Less"),
|
||||
List("one-to-two-weeks", "One to two weeks",
|
||||
"Backpacking trips of one to two weeks, as a source states it or as estimated from the length.",
|
||||
_band("two-weeks"), sort="time-asc", page_title="One-to-Two-Week Backpacking Trips: {n} Long Trails",
|
||||
@@ -252,7 +252,7 @@ LISTS = (
|
||||
List("off-trail", "Cross-country",
|
||||
"Trails with stretches of walking where there is no trail.",
|
||||
lambda r: facets.walking(r) in facets.CROSS_COUNTRY,
|
||||
page_title="Cross-Country Hiking: {n} Long Trails", group="walking",
|
||||
page_title="Long Trails with Cross-Country Stretches: {n} Trails", group="walking",
|
||||
noun="Cross-Country Hiking",
|
||||
short="Cross-Country Hikes"),
|
||||
List("mostly-cross-country", "Mostly cross-country",
|
||||
|
||||
@@ -95,13 +95,9 @@ def key_of(p):
|
||||
return p["slug"] if p["kind"] == "state" else (p["kind"], p["slug"])
|
||||
|
||||
|
||||
# The short noun a place page's title and heading use for each list, the same whatever the place's name:
|
||||
# the list's own short noun, but for these.
|
||||
PLACE_NOUN = {"a-week-or-less": "Trips of a Week or Less"}
|
||||
|
||||
|
||||
def place_noun(lst):
|
||||
return PLACE_NOUN.get(lst.key) or lst.short or lst.noun
|
||||
"""The short noun a place page's title and heading use for the list, the same whatever the name."""
|
||||
return lst.short or lst.noun
|
||||
|
||||
|
||||
def label(lst):
|
||||
|
||||
@@ -23,10 +23,12 @@ class ListWordingTest(unittest.TestCase):
|
||||
|
||||
def test_the_reworded_lists_have_the_new_page_titles(self):
|
||||
want = {
|
||||
"longest": "Longest Hiking Trails in the US: 7 Trails of 1,000+ Miles",
|
||||
"longest": "Longest Hiking Trails in the US and Canada: 7 Trails",
|
||||
"under-100-miles": "Short Thru-Hikes and Loops Under 100 Miles: 7 Trails",
|
||||
"under-200-miles": "Thru-Hikes and Loops Under 200 Miles: 7 Trails",
|
||||
"a-week-or-less": "Week-Long Backpacking Trips: 7 Long Trails",
|
||||
"a-week-or-less": "Backpacking Trips of a Week or Less: 7 Long Trails",
|
||||
"weekend": "Long-Weekend Backpacking Trips: 7 Long Trails",
|
||||
"off-trail": "Long Trails with Cross-Country Stretches: 7 Trails",
|
||||
"loops": "Backpacking Loops: 7 Long Trail Loops",
|
||||
}
|
||||
for key, title in want.items():
|
||||
@@ -39,7 +41,7 @@ class ListWordingTest(unittest.TestCase):
|
||||
self.assertNotIn("thru", browse.by_key("loops").page_title.lower())
|
||||
|
||||
def test_the_week_band_has_a_noun_and_loops_say_backpacking(self):
|
||||
self.assertEqual(browse.by_key("a-week-or-less").noun, "Week-Long Backpacking Trips")
|
||||
self.assertEqual(browse.by_key("a-week-or-less").noun, "Backpacking Trips of a Week or Less")
|
||||
self.assertEqual(browse.by_key("loops").noun, "Backpacking Loops")
|
||||
|
||||
def test_no_banned_word_and_no_best_in_any_list_wording(self):
|
||||
|
||||
Reference in new issue
Block a user