We are the web team at Kelin Textile, a hotel linen manufacturer in Nantong, China. Our product information starts life as a printed product catalogue: tables of models with fabric, thread count, style and the hotel grade each model is meant for. People read those tables on our website. Search engines, AI assistants and the occasional analyst read them too, and for them we wanted the same facts as structured data, not only as an HTML table.
This post describes how we publish the same catalogue as web pages and as files, and the decisions we would reuse on any catalogue site.
One source, several outputs
The site is a static Astro build. Every series and every model row lives in one file, src/data/catalog.json. Page templates render it into series pages, and the same data, through one function, becomes:
- the catalogue JSON and a CSV next to it,
- the schema.org markup on each series page (a
ProductGroupwith oneProductper model row, the table values asadditionalProperty), -
llms.txtandllms-full.txt.
The data files are Astro endpoints, so they are written in the same build as the pages:
export const GET: APIRoute = () => new Response(JSON.stringify(buildDataset(), null, 1) + '\n', { headers: { 'Content-Type': 'application/json; charset=utf-8' } }); There is no separate export step that can fall behind the pages. At the time of writing the dataset holds 37 series and 318 model rows in 10 categories; the CSV has 1,932 data rows.
Before any of this, one more check runs on the source: the series that come from the printed catalogue are compared with a cell-by-cell extraction of the catalogue PDF, so a value in catalog.json that differs from the printed table fails the build.
The JSON: nested, with provenance
The JSON follows the catalogue's own shape: categories, then series, then models. Every series carries its page URL and the catalogue page it comes from. Trimmed:
{ "name": "Kelin Textile hotel linen catalogue", … "terms": "Specifications as published by Kelin. Please cite the series page when reusing the data.", "version": "978252077a05", "categories": [ { "slug": "hotel-bedding-sets", … "series": [ { "slug": "bedding-plain-white", "name": "Plain White Series", "name_zh": "纯白系列", "url": "https://kelintextile.design/products/hotel-bedding-sets/plain-white/", "hs_codes": "6302.31 (woven cotton, embroidered, unprinted); …", … "source": "Kelin 2026 product catalogue, p.6", "columns": [ "Fabric", "Style", "Features", "Hotel Grade" ], "models": [ { "code": "KL-BS01", "values": { "Fabric": "300TC 100% Cotton", "Style": "Oxford", "Features": "5 cm flange, plain white", "Hotel Grade": "3–4-star" } }, … Where two published sources give different values for one field, the model keeps one value and the other goes into also_listed_as, so nothing is silently dropped. The terms field is the one sentence we ask reusers to follow: cite the series page.
The CSV: long format
Columns differ between series. A bedding set has Fabric, Style and Hotel Grade; a duvet has TC, Fill Type and Fill Weight. Across the catalogue there are 28 distinct attributes. A wide table would be mostly empty cells and would gain a column every time a new series added one.
So the CSV is long format, one row per model attribute. The header is fixed:
category,series,series_url,model,attribute,value,also_listed_as,source,series_name_zh,category_name_zh,hs_codes,cn_tariff_codes Four real rows (the first eight of the twelve columns; each row continues with the Chinese names and the HS codes):
Hotel Bedding Sets,Plain White Series,https://kelintextile.design/products/hotel-bedding-sets/plain-white/,KL-BS01,Fabric,300TC 100% Cotton,,"Kelin 2026 product catalogue, p.6",… Hotel Bedding Sets,Plain White Series,https://kelintextile.design/products/hotel-bedding-sets/plain-white/,KL-BS01,Style,Oxford,,"Kelin 2026 product catalogue, p.6",… Hotel Duvets,Feather Duvet Series,https://kelintextile.design/products/hotel-duvets/feather-down/,GD-280TC-01,Fill Type,Goose Down,,"Kelin 2026 product catalogue, p.16",… Hotel Duvets,Feather Duvet Series,https://kelintextile.design/products/hotel-duvets/feather-down/,GD-280TC-01,Fill Weight,200–280 gsm,,"Kelin 2026 product catalogue, p.16",… Every row carries its own page URL and source, so a single row pasted somewhere else still says where it came from. The CSV is generated from the JSON object, never from the source file directly, so the two cannot disagree. When we needed the Chinese names and HS codes, we appended four columns at the end and left the existing order alone, because the mirror build described below reads them.
Version = content hash
version is not a date or a counter. It is the first 12 hex digits of a SHA-256 over the categories:
const version = createHash('sha256').update(JSON.stringify(body)).digest('hex').slice(0, 12); Anyone can recompute it from the downloaded file. In Python, json.dumps with compact separators reproduces JSON.stringify for this data:
import json, hashlib d = json.load(open("kelin-hotel-linen-catalog.json", encoding="utf-8")) s = json.dumps({"categories": d["categories"]}, ensure_ascii=False, separators=(",", ":")) print(hashlib.sha256(s.encode()).hexdigest()[:12] == d["version"]) Two consequences we rely on. Rebuilding or redeploying the site without a data change gives the same version. And a copy that has been altered or truncated no longer matches its own version.
Copies that update only when the hash changes
The files are mirrored to a GitHub repository, together with a README.md, a CITATION.cff and a Frictionless datapackage.json. The same build writes a GitHub Pages site with one page per category and an Atom feed of releases. A Hugging Face copy carries the two files and a dataset card that loads the CSV as the default configuration.
A weekly GitHub Actions job (Mondays) downloads the live files, recomputes the hash, regenerates the expected CSV rows from the JSON and compares them with the downloaded CSV, then rebuilds the mirror. The mirror build depends only on its inputs, never on today's date, so an unchanged dataset produces identical files and no commit. A release tagged v-<version> is cut only when that tag does not exist yet. At the time of writing there are four releases.
schema.org Dataset on the landing page
The data page describes the files for people and carries a Dataset node for machines. As emitted, trimmed:
{"@type":"Dataset","@id":"https://kelintextile.design/data/#dataset","name":"Kelin Textile hotel linen catalogue","description":"Series and model tables published by Nantong Kelin Textile Co., Ltd. … Please cite the series page when reusing the data.","url":"https://kelintextile.design/data/","version":"978252077a05",…,"variableMeasured":["Application","Colour","Construction","Fabric",…,"Yarn Count"],"distribution":[{"@type":"DataDownload","encodingFormat":"application/json","contentUrl":"https://kelintextile.design/data/kelin-hotel-linen-catalog.json"},{"@type":"DataDownload","encodingFormat":"text/csv","contentUrl":"https://kelintextile.design/data/kelin-hotel-linen-catalog.csv"}],…} variableMeasured is simply the list of attribute names, and version is the same hash as in the file.
Keeping the page and the machine layer in agreement
Duplicated facts drift. Our answer is a set of checks that run inside every astro build (as an integration, so they also run when someone calls astro build directly). A few of them:
- a series page has exactly one
Productper table row, each tied to a row id that exists on the page, and everyskuappears in the visible text; - every URL on our domain in the markup exists in the build;
- the dataset
versionis a 12-hex hash and the CSV header is exactly the one above; - the HS codes printed on a page belong to that page's entries;
- every address in a URL baseline file, including both data files and
llms.txt, is still served.
We also decided what the machine layer may contain. Some text is meant for page readers only, and the checks fail the build if it shows up in the dataset or in llms.txt.
Stable URLs
The file names carry no version. kelin-hotel-linen-catalog.json is the current data; the version lives inside it. Links in search indexes, READMEs and other people's notebooks keep working, and the URL baseline check makes removing an address a deliberate decision rather than an accident.
llms.txt
llms.txt follows the llmstxt.org layout and is built from the same projection as the pages: a title with the legal name, a one-paragraph summary, company facts with their sources, the main pages, every category with its series and a one-line summary, the guides, the language versions, and a Data section:
## Data - [Catalogue dataset](https://kelintextile.design/data/): what the files contain, attributes and version - [Catalogue dataset, JSON](https://kelintextile.design/data/kelin-hotel-linen-catalog.json): every series and model table as data, with page URLs and sources - [Catalogue dataset, CSV](https://kelintextile.design/data/kelin-hotel-linen-catalog.csv): one row per model attribute, with page URL and source llms-full.txt adds the model tables and the FAQ. robots.txt lets search, AI-answer and training crawlers in and only hides /api/, /admin/ and a click counter.
HS codes as a join key
Customs declarations and trade statistics are keyed by HS code, not by product name. Each series carries hs_codes (6-digit Harmonized System) and cn_tariff_codes (8-digit China customs tariff), each with the condition that decides it, for example 6302.31 (woven cotton flat or fitted bed sheets, unprinted, without embroidery). The 6-digit prefix is the same in every country that uses the Harmonized System, so it is the column to join on. Split the field on ; and take the code before the parenthesis. The full table, with names in Chinese and Russian, is in our HS codes guide (HS 2022; China customs tariff 2026).
Summary
- Keep one source file and generate pages, data files, markup and
llms.txtfrom it in the same build. - Use long-format CSV when attributes vary by product family, and put the source and page URL on every row.
- Version by content hash, and release copies only when the hash changes.
- Fail the build when the visible page and the machine layer disagree.
- Keep file URLs stable and put the version inside the file.
The files are at https://kelintextile.design/data/.
