index-site
v0.1.24
Published
Reusable React application for a filesystem-backed index site.
Readme
index-site
Reusable React application for a filesystem-backed index site.
The consuming client calls startIndexSite() and provides three files in its
public directory:
index.site.jsonconfigures site-level behavior, including language, typography, map access, feature flags, and data paths.index.language.jsoncontains all user-facing copy, menu/filter labels, calendar messages, event-detail labels, and interpolated templates such as{count}and{date}.index.data.jsoncontains the root data set.
Data routing follows the URL. / and /items/:itemId load
/index.data.json. Any other content path loads its own nested file, so
/one/yes and /one/yes/items/:itemId load
/one/yes/index.data.json. View suffixes such as /map and /calendar also
keep the current content path.
dataPaths can override the convention with exact site-path mappings:
{
"language": "en",
"isRtl": false,
"dataPaths": {
"/one/yes": "/custom/one-yes.json"
}
}Site typography
Typography belongs to the site configuration:
{
"typography": {
"bodyFontFamily": "\"Open Sans\", sans-serif",
"headingFontFamily": "\"Open Sans\", sans-serif",
"googleFontsUrl": "https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap"
}
}index-site applies the font stacks through CSS variables and loads the
Google Fonts stylesheet when needed. A client may include the same stylesheet
URL in index.html with preconnect/preload hints; the runtime detects the
matching stylesheet and does not add a duplicate.
Keep each site's request script-specific. For example, Setúbal requests only Open Sans, while Tel Aviv requests the Hebrew-capable Rubik and Secular One families.
Maps and feature flags
The Google Maps browser key and lightbox behavior also belong to the site configuration:
{
"features": {
"lightboxDetails": true,
"lightboxDetailsMobile": true
},
"map": {
"apiKey": "YOUR_RESTRICTED_BROWSER_MAPS_KEY",
"center": {
"lat": 38.35,
"lng": -8.85
},
"zoom": 9
}
}Both lightbox flags default to true. Restrict the browser map key to the
required Google Maps APIs and deployed site origins.
