Files
longhikes/.github/workflows/validate.yml
T
swaitsandClaude Fable 5.2 5b80fccd1e
Mirror to forge / mirror (push) Canceled after 0s
Validate / validate (push) Canceled after 0s
Validate / history (push) Canceled after 0s
Validate / site (push) Canceled after 0s
Validate / deploy (push) Canceled after 0s
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>
2026-11-16 14:57:30 -07:00

69 lines
2.4 KiB
YAML

name: Validate
on:
push:
pull_request:
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: python3 tools/validate.py
# A change to a fact needs a new [[history]] entry (docs/schema.md). The check compares the
# work with its base, so it needs the history of the base branch: a full clone, not the
# shallow one that checkout makes by default.
history:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Check the history
env:
EVENT: ${{ github.event_name }}
BASE_REF: ${{ github.base_ref }}
BEFORE: ${{ github.event.before }}
run: |
# A pull request is checked against its target branch; a push against the commit
# before it. A new branch has no such commit: the tool then uses origin/main.
if [ "$EVENT" = "pull_request" ]; then
base="origin/$BASE_REF"
else
base="$BEFORE"
fi
python3 tools/check_history.py --base "$base"
- run: python3 -m unittest discover tools/tests -p "test_history.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 and make_cards.py are manual tools; web/thumbs/ and
# web/cards/ are committed and the build only copies them (web/olt/thumbs.py, cards.py).
- run: python3 -m unittest discover -s web/tests
- run: python3 web/build.py --out _site
# Netlify builds the site from this repository when asked to. Asking only
# after both jobs above pass means a broken record or page is never deployed.
deploy:
needs: [validate, history, site]
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'swaits/longhikes'
runs-on: ubuntu-latest
steps:
- name: Ask Netlify to build and publish main
env:
NETLIFY_BUILD_HOOK: ${{ secrets.NETLIFY_BUILD_HOOK }}
run: curl -fsS -X POST -d '{}' "$NETLIFY_BUILD_HOOK"