mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-08-26 17:31:37 +00:00
No description
- JavaScript 96.9%
- CSS 2.9%
- HTML 0.2%
The backend (navi-places wiki_rewrite) already turns each OSM wiki tag into a
complete URL in extratags.{wikipedia,wikidata,wikivoyage} -- a local Kiwix URL
(https://wiki.echo6.co/content/...) when the article is mirrored, otherwise the
public URL -- and records which in sources.wiki_rewrites[tag] = local|public.
PlaceCard and PlaceDetail ignored those rewritten values and rebuilt/linked from
the wrong fields, causing all three bugs. Verified against the live
/api/place/R/121355 (Twin Falls) response before and after.
- Bug 1 (Wikipedia "(local)" href was public): the link used the public
wiki-index field wiki_url with a hardcoded "(local)" badge, while the actual
local URL sat unused in extratags.wikipedia. Now links to extratags.wikipedia
and shows "(local)" only when sources.wiki_rewrites.wikipedia === "local".
- Bug 2 (Wikivoyage "(local)" href was public): same hardcoded badge on the
public wikivoyage_url. Now prefers the rewritten extratags.wikivoyage (local
when mirrored) and badges from sources.wiki_rewrites.wikivoyage; falls back to
the public wikivoyage_url with no "(local)" badge (Twin Falls has no mirror).
- Bug 3 (Wikidata URL doubled): the link prepended https://www.wikidata.org/wiki/
onto extratags.wikidata, which is already that full URL -> .../wiki/https://...
Now uses the value directly (only builds the URL for a bare Q-id).
New frontend/src/utils/wiki.js centralizes the builders (wikipediaLink,
wikivoyageLink, wikidataHref); both components import them, and the duplicated
public-URL builder (wikiUrl) is removed from each. No backend changes. Frontend
build clean; navi-places tests still 13 passed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| backend | ||
| frontend | ||