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>
69 lines
2.4 KiB
YAML
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"
|