mirror of
https://github.com/apache/superset.git
synced 2026-05-22 08:15:36 +00:00
MDX files can import JSON/YAML data from outside the section (e.g. admin_docs/configuration/country-map-tools.mdx imports ../../data/countries.json). Without intervention, the snapshot keeps reading the live data file, so the historical version's content silently changes whenever the data file is updated upstream. Add a freezeDataImports step to manage-versions.mjs that runs at cut time, before the depth-aware path rewriter: - Walks the freshly-snapshotted section dir - For each .md/.mdx file, finds escaping JSON/YAML imports (one or more ../) and resolves them against the file's original location - Copies the resolved file into <snapshot>/_versioned_data/, preserving its path relative to docs/ (the underscore prefix keeps Docusaurus from treating it as content) - Rewrites the import to point at the snapshot-local copy Verified end-to-end with a throwaway admin_docs cut: the snapshot's country-map-tools page renders all 201 countries from a frozen JSON, and a subsequent edit to the live docs/data/countries.json does not affect the snapshot's rendered output.