diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..f5bd7bb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: Long Hikes website + url: https://longhikes.org + about: Browse the trails and routes, each record, its source, and its track where it may be shared. diff --git a/.github/ISSUE_TEMPLATE/correction.yml b/.github/ISSUE_TEMPLATE/correction.yml new file mode 100644 index 0000000..c11a052 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/correction.yml @@ -0,0 +1,49 @@ +name: Correction +description: A record is wrong or out of date +title: "Correction: " +body: + - type: markdown + attributes: + value: | + Thank you for helping correct this dataset. You do not need to use git: + fill in this form and a maintainer can make the change. + + Every record is a text file, `/trail.toml`. A correction needs a + source it can be checked against, so please give one below. + - type: input + id: trail + attributes: + label: Trail + description: The record id (shown on the trail's page, for example `arizona`), or the trail's name. + placeholder: "arizona" + validations: + required: true + - type: textarea + id: wrong + attributes: + label: What is wrong? + description: The fact, length, link, track, licence or other detail that is wrong or out of date. + validations: + required: true + - type: textarea + id: should + attributes: + label: What should it be? + description: The corrected information, as exactly as you can give it. + validations: + required: true + - type: input + id: source + attributes: + label: Where can it be checked? + description: A source page, map or other page where the correct information can be checked. For a corrected track, name where the track came from and its licence as well. + placeholder: "https://" + validations: + required: true + - type: textarea + id: notes + attributes: + label: Notes + description: Anything else that would help (optional). + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/new-trail.yml b/.github/ISSUE_TEMPLATE/new-trail.yml new file mode 100644 index 0000000..4de12bb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/new-trail.yml @@ -0,0 +1,83 @@ +name: Suggest a trail +description: A trail or route that is missing +title: "New trail: " +body: + - type: markdown + attributes: + value: | + Thank you for suggesting a trail or route. You do not need to use git: + fill in this form and a maintainer can add the record. + + The inclusion rule (see README.md): a named, continuous walking route, + or a named loop, of at least 50 miles (80 km) — a few well-known + multi-day trails of 60–80 km are also listed — in the United States or + Canada. It is either a trail that a land agency or a trail association + designates, maintains and publishes as one trail, or a person-defined + route that a person or a small group worked out and published (a high + route, a traverse, or a loop of linked trails). + + A trail can be listed as a record only, with no track, when no track + for it may be shared. A track is included only where its source's + terms allow it to be passed on. + - type: input + id: name + attributes: + label: Name + description: The trail's or route's published name. + validations: + required: true + - type: textarea + id: where + attributes: + label: Where is it? + description: Country, and the states, provinces or territories it passes through. + validations: + required: true + - type: input + id: length + attributes: + label: Length + description: The published length, in miles or kilometres, and where that figure comes from if you know it. The floor is 50 miles (80 km), apart from a few well-known trails of 60–80 km. + placeholder: "e.g. 120 miles (193 km)" + validations: + required: true + - type: input + id: steward + attributes: + label: Steward or creator + description: The land agency or trail association that designates, maintains and publishes it as one trail — or, for a person-defined route, the person or small group who worked it out and published it. + validations: + required: true + - type: input + id: official-page + attributes: + label: Official page + description: The steward's or creator's own page for the trail or route (for a route, where it is got from the creator — the guidebook, map set or page, and whether it is free or sold). + placeholder: "https://" + validations: + required: true + - type: dropdown + id: track-exists + attributes: + label: Is there a track? + description: A GPX, GeoJSON or other track of the route published by the steward or creator, or an OpenStreetMap route relation. + options: + - "Yes" + - "No" + - "I don't know" + validations: + required: false + - type: textarea + id: track-terms + attributes: + label: Track terms + description: If there is a track, where is it, and on what terms may it be passed on? A track is included only where its source's terms allow passing it on. For a person-defined route whose creator sells the route or chooses not to publish a track, the record will hold no track and will point to the creator instead. + validations: + required: false + - type: textarea + id: notes + attributes: + label: Notes + description: Anything else that would help (optional). + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/removal.yml b/.github/ISSUE_TEMPLATE/removal.yml new file mode 100644 index 0000000..298b253 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/removal.yml @@ -0,0 +1,58 @@ +name: Removal or credit request +description: Ask for a track or logo to be removed or replaced, or its credit changed +title: "Removal: " +body: + - type: markdown + attributes: + value: | + For stewards, route creators and rights holders. If you want a track + or a logo removed or replaced, or its credit changed, please say so + here and it will be acted on: the file will be removed or replaced + and the record updated to say so. Logos are shown only to identify + each trail and belong to their holders. A route's creator can also + ask for the route's record to be corrected or removed. + + Issues in this repository are public, so please do not post a + private email address or phone number here unless you are content + for it to be public. + - type: input + id: trail + attributes: + label: Trail + description: The record id (shown on the trail's page, for example `arizona`), or the trail's name. + placeholder: "arizona" + validations: + required: true + - type: input + id: relation + attributes: + label: Who are you in relation to the trail? + description: For example the trail's steward, the route's creator, the logo's holder, or the track's publisher. + validations: + required: true + - type: dropdown + id: kind + attributes: + label: What is the request about? + options: + - "A track" + - "A logo" + - "A credit" + - "The record itself" + - "Something else" + validations: + required: false + - type: textarea + id: request + attributes: + label: What should be removed or changed? + description: Say which file or credit, and what you would like done — removed, replaced, or credited differently (and with what wording). If you can, give the page that states your terms. + validations: + required: true + - type: input + id: contact + attributes: + label: How may we contact you? + description: Replies to this issue reach you through GitHub. Say here only if you would prefer another way, and only with details you are content to have public. + validations: + required: false diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..571c6c6 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,12 @@ +## What changed + + + +## Checklist + +- [ ] One trail per pull request, where practical, and only that trail's directory changed. +- [ ] The validator passes: `python3 tools/build_index.py`, then `python3 tools/validate.py` prints `OK trails`. +- [ ] The source for each changed fact is named (where it can be checked: a source page, a map, or a measured track). +- [ ] A track is included only where its source's terms allow it to be passed on (`redistributable` is `true` for every included file; see `docs/schema.md`). OpenStreetMap tracks carry the credit "© OpenStreetMap contributors" under the ODbL. Where a publisher's track may not be passed on, no track is included and the record says why (`source.line_absent_reason`). +- [ ] For a person-defined route, the track follows the creator's choice (`route.line_policy`): no track is included from any source, OpenStreetMap included, where the creator sells the route, withholds the track, or the position is not settled. +- [ ] `release.txt` is updated where track files changed (source, licence, date read), and any logo names its holder (`shield.logo_owner`) and where the art came from (`shield.logo_source`). diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 1822693..9c627a4 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -11,5 +11,18 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.x" + python-version: "3.12" - run: python3 tools/validate.py + + site: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + # Standard library only: no packages to install, and no ImageMagick. + # web/tools/make_thumbs.py is a manual tool; web/thumbs/ is committed + # and the build only copies those thumbnails (see web/olt/thumbs.py). + - run: python3 -m unittest discover -s web/tests + - run: python3 web/build.py --out _site diff --git a/web/olt/docs.py b/web/olt/docs.py index a5fc5d7..b423abf 100644 --- a/web/olt/docs.py +++ b/web/olt/docs.py @@ -54,7 +54,7 @@ def _classify(href, site): if key.startswith("licenses/") and key.endswith(".txt"): return "/licences/" + norm.split("/", 1)[1] + (f"#{frag}" if frag else "") if site.repo_url: - return f"{site.repo_url}/blob/main/{norm}" + (f"#{frag}" if frag else "") + return site.blob_url(norm) + (f"#{frag}" if frag else "") return None @@ -228,7 +228,7 @@ def logos_page(records, site, repo_root):

Marks

Logos

Logos are shown only to identify each trail. They belong to their holders.

-
{notice_html}
+
{notice_html}{f'

Ask for a track or logo to be removed, or its credit changed.

' if site.is_github else ""}

Every logo in the dataset

{len(with_logo)} records include a logo file.

    {cards}
@@ -246,7 +246,11 @@ def about_page(records, site, repo_root): "How to use it", "Report an error", "Licences", "Sources"]), site) contrib = render_doc(read_doc(repo_root, "CONTRIBUTING.md"), site, heading_offset=1) extra = "" - if site.issues_url: + if site.repo_url and site.is_github: + extra = (f'

Report a problem with a record, or ' + f'suggest a trail that is missing: ' + f'short forms, no git needed. Or fix or add a trail yourself in the source repository.

') + elif site.issues_url: extra = f'

Open an issue to report an error.

' if site.repo_url: extra += f'

Source repository: {esc(site.repo_url)}.

' diff --git a/web/olt/home.py b/web/olt/home.py index f9c38b4..a01a17c 100644 --- a/web/olt/home.py +++ b/web/olt/home.py @@ -311,12 +311,19 @@ def render(records, site): lede = (f"A record for each of {total} long trails and routes, as a rule 50 miles (80 km) or more: " "what it is, how long it is, who publishes it, and on what terms its track may be passed on. " "Where the terms allow, download the track as GPX or GeoJSON.") + contribute = "" + if site.repo_url: + contribute = (f'

Something wrong, or a trail missing? ' + f'Report a problem or ' + f'suggest a trail; ' + f'the records are text files anyone can fix or add to.

') return f"""

A public dataset · United States and Canada

{esc(site.tagline)}

{lede}

This is a dataset, not a navigation product. Tracks vary in quality, some trails are unfinished, and some records have no track at all; each of those says why.

+ {contribute}

Find a trail

diff --git a/web/olt/layout.py b/web/olt/layout.py index f2c9f35..9f74ecd 100644 --- a/web/olt/layout.py +++ b/web/olt/layout.py @@ -60,8 +60,11 @@ def header(path, site): def footer(site): - report = (f'
  • Report an error in a record
  • ' - if site.issues_url else "") + report = "" + if site.repo_url: + report = (f'
  • Report an error in a record
  • ' + f'
  • Suggest a trail
  • ' + f'
  • Fix or add a trail
  • ') return Markup(f"""