Skip to content

feat: landing pages for every country - #365

Merged
yakew7 merged 2 commits into
mainfrom
feat/country-pages
Nov 24, 2026
Merged

yakew7 merged 2 commits into
mainfrom
feat/country-pages

Conversation

@propcgamer20-png

Copy link
Copy Markdown
Member

What this changes

#358: a landing page per country, next to the city pages.

Page (/country/<code>), generated from the dataset:

  • a count per category, each linking to /map filtered to that country and category;
  • the country's cities, linking to their existing /city/<slug> pages, biggest first;
  • a "Start here" list that puts verified places first;
  • a Country plus ItemList JSON-LD block, a generated Open Graph image in the same style as the city cards, and a meta description built from the real counts (same rule as City page meta description calls every place an "exam centre" #290: nothing for categories the country lacks).

Links in: the sitemap (one entry per country, lastmod from the newest verified place like the city entries), a country breadcrumb on each city page, and "View page" next to the map's country filter once a country is chosen.

Canonical URL: the only URL is the lowercase code. /country/IN is a 404 and a code not in the dataset is a 404, so each country has exactly one page.

Type of change

  • Code or fix

Testing

  • npm run typecheck, npm run lint, npm run test:unit (793 tests) and prettier --check src pass.
  • Counts match /stats, as the issue requires: a test runs computeStats on the real dataset and checks there is one page per counted country and that every country's page holds exactly the places /stats counts for it. Also checked: every place with a country is on exactly one page, and a country's city counts add up to its total.
  • Other tests: grouping and ordering, the 404 cases (unknown, empty, ../in, uppercase), countryOfCity, the top-places order, the meta description in singular and plural, the JSON-LD (including < escaping), the OG summary, the sitemap entries, and the map link appearing only once a country is chosen.
  • I ran the production build and read the generated output. country/in.html has the canonical https://studyymap.com/country/in, the description "219 places (50 libraries, ... and 62 government offices) across 30 cities", a Country + 30-city ItemList, 30 city links, and a 1200x630 image with the right numbers. The tests also caught a real bug in my first JSON-LD helper (the < escape was a no-op), fixed before this PR.

Not covered

  • The build prints a Next.js security advisory for the installed version and stops at its final check (after the routes are generated). That is about the repo's next version, not this change, but the maintainer may want to look at it.
  • Checked by tests and by reading the build output, not by eye in a browser.
  • No changelog line, to avoid conflicts with the other open PRs.

Closes #358

/country/<code> is generated from the dataset next to the city pages: a
count per category (each linking to the map filtered to that country), the
country's cities linking to their existing city pages, and a short 'start
here' list that puts verified places first. It carries a schema.org Country
with an ItemList of its cities, a generated Open Graph image in the same
style as the city cards, and a meta description built from real counts.

The only URL is the lowercase code, so /country/IN is a 404 and there is one
canonical page per country. Counts are checked against the same tally that
/stats uses.

Part of #358
Country pages join the sitemap (lastmod from the newest verified place, like
the city entries), each city page gets a country breadcrumb, and the map
shows 'View <country> page' next to the country filter once a country is
chosen.

Closes #358
@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
study-map Ready Ready Preview Nov 24, 2026 9:41am UTC

@yakew7
yakew7 merged commit d3af481 into main Nov 24, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
Preview — 07dcf2df Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add country landing pages next to the city pages

2 participants