Uh oh!
There was an error while loading. Please reload this page.
feat: add JSON-LD Place structured data to city pages (#120) - #136
Conversation
) Each place on a city page now gets a schema.org JSON-LD block using a specific subtype where one genuinely fits (Library, GovernmentOffice, Airport) and Place otherwise. Only real dataset fields are emitted: name, address, geo with latitude/longitude, and a deep link to the place's map pin. geo is omitted entirely when coordinates are missing or unusable, and address when absent — no placeholders, so the structured data can never misrepresent the page. ClosesStudentSuite#120
@aryansk is attempting to deploy a commit to the studentsuite Team on Vercel. A member of the Team first needs to authorize it. |
shauryagangrade
commented
Aug 15, 2026
Thanks for the thorough work and the tests — this looks good overall. CI’s typecheck is failing on a small TypeScript issue in the new tests (TS2352): the tests create Place-like objects with lat/lng set to undefined and then assert them to type Place, which tsc rejects. Minimal fix Suggested patch (ready to paste): - const withoutLat = { ...place(), lat: undefined } as Place;+ const withoutLat = ({ ...place(), lat: undefined } as unknown) as Place;
expect(placeJsonLd(withoutLat)).not.toHaveProperty("geo");
- const withoutLng = { ...place(), lng: undefined } as Place;+ const withoutLng = ({ ...place(), lng: undefined } as unknown) as Place;
expect(placeJsonLd(withoutLng)).not.toHaveProperty("geo");Suggested commit message Next steps
Thanks again — low-risk change and tests look comprehensive; once CI is green this should be good to merge. |
Uh oh!
There was an error while loading. Please reload this page.
What
City pages now emit one schema.org JSON-LD
<script type="application/ld+json">block per place, exactly as #120 specifies.@typepicks a specific subtype where one genuinely fits —Library,GovernmentOffice,Airport— and falls back toPlaceotherwisename,address,geo(GeoCoordinateswithlatitude/longitude), andurlpointing at the place's map deep link (/map?place=<id>)addressomit it; places with missing or non-finite coordinates omitgeoentirely — never nulls, never placeholders, so the structured data cannot misrepresent the pageHow it was verified
src/lib/jsonld.test.ts, 11 tests) cover the type mapping, the deep link, and the "omit rather than fake" rules from the acceptance criterianpx vitest run— 63/63 pass (incl. 11 new)npx eslinton changed files — cleannpm run build— clean; checked the generated static HTML: 27 valid JSON-LD blocks on/city/mumbaiwith real data (Library,Airport,GovernmentOfficesubtypes all present), and address-less places correctly emitname/geo/urlonlyNotes
I can't attach a Rich Results Test screenshot from here (no browser), but every block is plain schema.org
Place-family data with only genuinely-held fields, so the test should report no errors — happy to adjust if a manual run surfaces anything.Closes#120