From 386a0ae74fa42dc3b7fa72063f1edc4a047630e5 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 3 Sep 2024 14:52:07 -0500 Subject: [PATCH 01/14] CLDR-17803 docs/site: wip on generation --- .github/workflows/site.yml | 2 + docs/site/.gitignore | 2 + docs/site/_layouts/page.html | 1 + docs/site/assets/js/build.mjs | 60 +++++++++++++++ docs/site/package-lock.json | 120 +++++++++++++++++++++++++++++ docs/site/package.json | 18 +++++ tools/scripts/web/docker/README.md | 4 + 7 files changed, 207 insertions(+) create mode 100644 docs/site/.gitignore create mode 100644 docs/site/assets/js/build.mjs create mode 100644 docs/site/package-lock.json create mode 100644 docs/site/package.json diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml index 87f2021f978..3f7946caf03 100644 --- a/.github/workflows/site.yml +++ b/.github/workflows/site.yml @@ -34,6 +34,8 @@ jobs: bundler-cache: true - name: Setup Jekyll run: 'gem install bundler jekyll kramdown-parser-gfm webrick' + - name: Setup assets + run: 'cd docs/site/assets && npm ci && npm run build' - name: Build cldr.pages.dev run: 'cd docs/site && jekyll build' - name: Pre-install Wrangler diff --git a/docs/site/.gitignore b/docs/site/.gitignore new file mode 100644 index 00000000000..9fbbb2c6f27 --- /dev/null +++ b/docs/site/.gitignore @@ -0,0 +1,2 @@ +/node_modules +/assets/json diff --git a/docs/site/_layouts/page.html b/docs/site/_layouts/page.html index adff46349b0..dd97e1fa7bd 100644 --- a/docs/site/_layouts/page.html +++ b/docs/site/_layouts/page.html @@ -31,6 +31,7 @@ + + diff --git a/docs/site/assets/css/page.css b/docs/site/assets/css/page.css index e0f982f007a..2c6a3403a17 100644 --- a/docs/site/assets/css/page.css +++ b/docs/site/assets/css/page.css @@ -17,14 +17,23 @@ header > div { display: table-cell; } -header > div.nav { - display: block !important; -} - header > div.icon { flex-grow: 1; } +header .title { + color: white; + font-size: 1.5em; +} + +header .nav, header .nav > div { + display: inline; +} + +header .nav a, header .nav .title { + color: white; +} + footer { width: 100%; margin-left: auto; diff --git a/docs/site/assets/js/cldrsite.js b/docs/site/assets/js/cldrsite.js new file mode 100644 index 00000000000..623a7cbaaa2 --- /dev/null +++ b/docs/site/assets/js/cldrsite.js @@ -0,0 +1,207 @@ +const { ref } = Vue; + +// site management + +/** replace a/b/c.md with a/b */ +function path2dir(p) { + const dir = p.split('/').slice(0,-1).join('/'); + return dir; +} + +/** replace a/b/c.md with a/b/c.html */ +function md2html(p) { + return (p.replace(/\.md$/,'.html')); +} + +/** replace a/b/c.html with a/b/c.md */ +function html2md(p) { + return (p.replace(/\.html$/,'.md')); +} + +/** load and cook the site data */ +async function siteData() { + // load the json + const d = await fetch('/assets/json/tree.json'); + const j = await d.json(); + const { all } = j; + + // 'all' is an array of { title, fullPath } entries. + // Flat list of paths + const allPaths = all.map(({fullPath})=>(fullPath)); + // Find all 'directories' (ending with /) + const allDirs = new Set(); + allPaths.forEach(p => { + const segs = p.split('/').slice(0,-1); // ['', 'dir1'] + for(let n=0; n<=segs.length; n++) { + // add all parent paths, so: '', dir1, dir1/dir2 etc. + const subpath = segs.slice(0,n).join('/'); + allDirs.add(subpath); + } + }); + j.allDirs = {}; + j.allIndexes = []; + // allDirs: '', index, downloads, etc… + allDirs.forEach(dir => { + // presumed index page: /downloads -> /downloads.md + // also / -> /index.md + const dirIndex = `${dir || 'index'}.md`; + // console.dir({dir, dirIndex}); + if (allPaths.indexOf(dirIndex) !== -1) { + j.allDirs[dir] = {index: dirIndex}; + j.allIndexes.push(dirIndex); + } else { + console.error(`No index page: ${dirIndex}`); + j.allDirs[dir] = {}; + } + j.allDirs[dir].pages = []; + }); + allPaths.forEach(p => { + const dir = path2dir(p); + j.allDirs[dir].pages.push(p); + }); + // map md -> title + j.title = {}; + all.forEach(({title, fullPath}) => j.title[fullPath] = title); + return j; +} + + +const app = Vue.createApp({ + setup(props) { + const tree = ref({}); + const status = ref(null); + + return { + tree, + status, + } + }, + mounted() { + const t = this; + siteData().then(d => t.tree.value = d, e => t.status = e); + }, + props: { + path: String, + }, + computed: { + mdPath() { + if(this.path) { + return html2md(this.path) + } + return null; + }, + ourDir() { + if(this.path) { + return path2dir(this.path); + } + return ''; + }, + ourIndex() { + if(this.tree?.value) { + // first ARE we an index page? + if (this.tree.value.allIndexes.indexOf(this.mdPath) != -1) { + return this.mdPath; // we are an index + } + return this.tree.value.allDirs[this.ourDir].index; + } + return null; + }, + ourIndexHtml() { + if (this.ourIndex) { + return md2html(this.ourIndex); + } else { + return null; + } + }, + ourIndexTitle() { + if (this.ourIndex && this.tree?.value) { + return this.tree.value.title[this.ourIndex] || this.ourIndex; + } else { + return null; + } + }, + ourTitle() { + if (this.tree?.value) { + if (this.path === '') return this.rootTitle; + return this.tree.value.title[html2md(this.path)]; + } + }, + // title of root + rootTitle() { + return this.tree?.value?.title['index.md']; + }, + // list of pages for siblings of this dir + siblingPages() { + if (!this.tree?.value) return []; + const dirForPage = this.ourDir; + let thePages = this.tree?.value?.allDirs[dirForPage].pages ?? []; + if (dirForPage === '') { + thePages = [...thePages, ...this.tree?.value?.allDirs['index'].pages]; + } + const c = new Intl.Collator([]); + return ( thePages ) + .map((path) => ({ + path, + html: md2html(path), + title: this.tree.value.title[path] ?? path, + })) + .sort((a, b) => c.compare(a.title, b.title)); + }, + }, + template: `
+
{{ status }}
+
Loading…
+ + {{ rootTitle }} | + + + + + {{ ourIndexTitle }} + + | + + {{ ourTitle }} + +
` +}, { + // path of / goes to /index.html + path: (window.location.pathname.slice(1) || 'index.html'), +}); + +app.component( + 'CldrPage', + { + setup() { + + }, + template: `

Hello

+ ` + } +); + +app.component( + 'CldrList', + { + setup() { + + }, + template: ` +

Hullo

+ ` + } +); + + +app.mount('#nav'); diff --git a/docs/site/development.md b/docs/site/development.md new file mode 100644 index 00000000000..3a7243a90f9 --- /dev/null +++ b/docs/site/development.md @@ -0,0 +1,5 @@ +--- +title: CLDR Development +--- + +Development pages diff --git a/docs/site/development/development-process.md b/docs/site/development/development-process.md new file mode 100644 index 00000000000..93787983a16 --- /dev/null +++ b/docs/site/development/development-process.md @@ -0,0 +1,5 @@ +--- +title: CLDR Development Process +--- + +Pages related to our development process diff --git a/docs/site/downloads.md b/docs/site/downloads.md new file mode 100644 index 00000000000..c0ba26dd517 --- /dev/null +++ b/docs/site/downloads.md @@ -0,0 +1,4 @@ +--- +title: CLDR Downloads +--- + diff --git a/docs/site/index/corrigenda.md b/docs/site/index/corrigenda.md index 1359fe007ae..7da7241fe63 100644 --- a/docs/site/index/corrigenda.md +++ b/docs/site/index/corrigenda.md @@ -1,5 +1,5 @@ --- -title: CLDR Releases/Downloads +title: Corrigenda and Errata --- # Corrigenda and Errata @@ -15,4 +15,4 @@ At this time, there is only one Corrigendum: Each release of CLDR is a stable release and may be used as reference material or cited as a normative reference by other specifications. Each version, once published, is absolutely stable and will never change. However, implementations may - and are encouraged to - apply fixes for corrigenda and errata to their use of an appropriate version. For example, an implementation may claim conformance to "CLDR 1.3, as amended by Corrigendum 1". -![Unicode copyright](https://www.unicode.org/img/hb_notice.gif) \ No newline at end of file +![Unicode copyright](https://www.unicode.org/img/hb_notice.gif) diff --git a/docs/site/package-lock.json b/docs/site/package-lock.json index dc1b0fdd488..61e53a3ef3b 100644 --- a/docs/site/package-lock.json +++ b/docs/site/package-lock.json @@ -10,9 +10,148 @@ "license": "Unicode-3.0", "dependencies": { "gray-matter": "^4.0.3", - "petite-vue": "^0.4.1" + "vue": "^3.5.0" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", + "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz", + "integrity": "sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==", + "dependencies": { + "@babel/types": "^7.25.6" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", + "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", + "dependencies": { + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==" + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.0.tgz", + "integrity": "sha512-ja7cpqAOfw4tyFAxgBz70Z42miNDeaqTxExTsnXDLomRpqfyCgyvZvFp482fmsElpfvsoMJUsvzULhvxUTW6Iw==", + "dependencies": { + "@babel/parser": "^7.25.3", + "@vue/shared": "3.5.0", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.0.tgz", + "integrity": "sha512-xYjUybWZXl+1R/toDy815i4PbeehL2hThiSGkcpmIOCy2HoYyeeC/gAWK/Y/xsoK+GSw198/T5O31bYuQx5uvQ==", + "dependencies": { + "@vue/compiler-core": "3.5.0", + "@vue/shared": "3.5.0" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.0.tgz", + "integrity": "sha512-B9DgLtrqok2GLuaFjLlSL15ZG3ZDBiitUH1ecex9guh/ZcA5MCdwuVE6nsfQxktuZY/QY0awJ35/ripIviCQTQ==", + "dependencies": { + "@babel/parser": "^7.25.3", + "@vue/compiler-core": "3.5.0", + "@vue/compiler-dom": "3.5.0", + "@vue/compiler-ssr": "3.5.0", + "@vue/shared": "3.5.0", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.11", + "postcss": "^8.4.44", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.0.tgz", + "integrity": "sha512-E263QZmA1dqRd7c3u/sWTLRMpQOT0aZ8av/L9SoD/v/BVMZaWFHPUUBswS+bzrfvG2suJF8vSLKx6k6ba5SUdA==", + "dependencies": { + "@vue/compiler-dom": "3.5.0", + "@vue/shared": "3.5.0" + } + }, + "node_modules/@vue/reactivity": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.0.tgz", + "integrity": "sha512-Ew3F5riP3B3ZDGjD3ZKb9uZylTTPSqt8hAf4sGbvbjrjDjrFb3Jm15Tk1/w7WwTE5GbQ2Qhwxx1moc9hr8A/OQ==", + "dependencies": { + "@vue/shared": "3.5.0" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.0.tgz", + "integrity": "sha512-mQyW0F9FaNRdt8ghkAs+BMG3iQ7LGgWKOpkzUzR5AI5swPNydHGL5hvVTqFaeMzwecF1g0c86H4yFQsSxJhH1w==", + "dependencies": { + "@vue/reactivity": "3.5.0", + "@vue/shared": "3.5.0" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.0.tgz", + "integrity": "sha512-NQQXjpdXgyYVJ2M56FJ+lSJgZiecgQ2HhxhnQBN95FymXegRNY/N2htI7vOTwpP75pfxhIeYOJ8mE8sW8KAW6A==", + "dependencies": { + "@vue/reactivity": "3.5.0", + "@vue/runtime-core": "3.5.0", + "@vue/shared": "3.5.0", + "csstype": "^3.1.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.0.tgz", + "integrity": "sha512-HyDIFUg+l7L4PKrEnJlCYWHUOlm6NxZhmSxIefZ5MTYjkIPfDfkwhX7hqxAQHfgIAE1uLMLQZwuNR/ozI0NhZg==", + "dependencies": { + "@vue/compiler-ssr": "3.5.0", + "@vue/shared": "3.5.0" + }, + "peerDependencies": { + "vue": "3.5.0" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.0.tgz", + "integrity": "sha512-m9IgiteBpCkFaMNwCOBkFksA7z8QiKc30ooRuoXWUFRDu0mGyNPlFHmbncF0/Kra1RlX8QrmBbRaIxVvikaR0Q==" + }, "node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -21,6 +160,22 @@ "sprintf-js": "~1.0.2" } }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -33,6 +188,11 @@ "node": ">=4" } }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, "node_modules/extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", @@ -86,10 +246,62 @@ "node": ">=0.10.0" } }, - "node_modules/petite-vue": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/petite-vue/-/petite-vue-0.4.1.tgz", - "integrity": "sha512-/gtYKQe9r1OV4IEwn2RsPXAHgFTe1nVq4QhldAP6/l8DSe9I754K6Oe1+Ff6dbnT5P8X2XP7PTUZkGRz5uFnFQ==" + "node_modules/magic-string": { + "version": "0.30.11", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz", + "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/picocolors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", + "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==" + }, + "node_modules/postcss": { + "version": "8.4.44", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.44.tgz", + "integrity": "sha512-Aweb9unOEpQ3ezu4Q00DPvvM2ZTUitJdNKeP/+uQgr1IBIqu574IaZoURId7BKtWMREwzKa9OgzPzezWGPWFQw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.1", + "source-map-js": "^1.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } }, "node_modules/section-matter": { "version": "1.0.0", @@ -103,6 +315,14 @@ "node": ">=4" } }, + "node_modules/source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -115,6 +335,34 @@ "engines": { "node": ">=0.10.0" } + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "engines": { + "node": ">=4" + } + }, + "node_modules/vue": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.0.tgz", + "integrity": "sha512-1t70favYoFijwfWJ7g81aTd32obGaAnKYE9FNyMgnEzn3F4YncRi/kqAHHKloG0VXTD8vBYMhbgLKCA+Sk6QDw==", + "dependencies": { + "@vue/compiler-dom": "3.5.0", + "@vue/compiler-sfc": "3.5.0", + "@vue/runtime-dom": "3.5.0", + "@vue/server-renderer": "3.5.0", + "@vue/shared": "3.5.0" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } } } } diff --git a/docs/site/package.json b/docs/site/package.json index 455523af7a1..f4095933d42 100644 --- a/docs/site/package.json +++ b/docs/site/package.json @@ -13,6 +13,6 @@ "private": true, "dependencies": { "gray-matter": "^4.0.3", - "petite-vue": "^0.4.1" + "vue": "^3.5.0" } } From 5be2d36a141ddfc37015f23720070f0b9546d88d Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 4 Sep 2024 16:46:16 -0500 Subject: [PATCH 04/14] CLDR-17803 docs/site: fix frontmatter err --- docs/site/development/cldr-big-red-switch.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/site/development/cldr-big-red-switch.md b/docs/site/development/cldr-big-red-switch.md index 68d6e47a301..f25bf979637 100644 --- a/docs/site/development/cldr-big-red-switch.md +++ b/docs/site/development/cldr-big-red-switch.md @@ -1,5 +1,5 @@ --- -title: CLDR: Big Red Switch +title: 'CLDR: Big Red Switch' --- # CLDR: Big Red Switch @@ -12,7 +12,7 @@ title: CLDR: Big Red Switch ### Trial New Version (Let us know if you need write access!) -(For editors: [List View of BRS](https://cldr.unicode.org/development/cldr-big-red-switch/list-view-of-brs), [Spreadsheet View](https://docs.google.com/spreadsheets/d/1dIOLxKX2gW7BRDVdMBH9qr1GdxpPj8Bc1Pe-02p_92k/edit#gid=0)) +(For editors: [List View of BRS](https://cldr.unicode.org/development/cldr-big-red-switch/list-view-of-brs), [Spreadsheet View](https://docs.google.com/spreadsheets/d/1dIOLxKX2gW7BRDVdMBH9qr1GdxpPj8Bc1Pe-02p_92k/edit#gid=0)) ## Contributor Message @@ -28,4 +28,4 @@ However, names are not automatically entered there, since some people may not wi 2. e\-mail that list **on BCC:** the above message with a subject line of "\[CLDR X.Y Contributor Message]", and a request to please keep the subject line intact. 3. Then, the subject line can be used to filter/locate the contributor requests. -![Unicode copyright](https://www.unicode.org/img/hb_notice.gif) \ No newline at end of file +![Unicode copyright](https://www.unicode.org/img/hb_notice.gif) From a32c994abe08b79fd69438dd40c6143ddc44bd2e Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 4 Sep 2024 16:49:09 -0500 Subject: [PATCH 05/14] CLDR-17803 docs/site: forgot a 'mkdir' --- docs/site/assets/js/build.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/site/assets/js/build.mjs b/docs/site/assets/js/build.mjs index a60b51d82d5..bfd3b4e47fa 100644 --- a/docs/site/assets/js/build.mjs +++ b/docs/site/assets/js/build.mjs @@ -47,6 +47,7 @@ async function main() { all: [], dirs: {}, }; + await fs.mkdir('assets/json/', { recursive: true }); await traverse('.', out); await fs.writeFile('assets/json/tree.json', JSON.stringify(out, null, ' ')); } From 8f20995431a88b93ca67a7609f77dc321962b27d Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 4 Sep 2024 16:51:38 -0500 Subject: [PATCH 06/14] CLDR-17803 docs/site: more fixup --- .../updating-codes/update-languagescriptregion-subtags.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/site/development/updating-codes/update-languagescriptregion-subtags.md b/docs/site/development/updating-codes/update-languagescriptregion-subtags.md index 51b35bd05e7..54dfd70181d 100644 --- a/docs/site/development/updating-codes/update-languagescriptregion-subtags.md +++ b/docs/site/development/updating-codes/update-languagescriptregion-subtags.md @@ -22,7 +22,7 @@ title: Update Language/Script/Region Subtags - Save as {CLDR}/tools/cldr\-code/src/main/resources/org/unicode/cldr/util/data/language\-subtag\-registry - Go to http://data.iana.org/TLD/ - Right\-click on [tlds\-alpha\-by\-domain.txt](http://data.iana.org/TLD/tlds-alpha-by-domain.txt) save as - - {{CLDR}/tools/cldr\-code/src/main/resources/org/unicode/cldr/util//data/[tlds\-alpha\-by\-domain.txt](http://data.iana.org/TLD/tlds-alpha-by-domain.txt) + - {CLDR}/tools/cldr\-code/src/main/resources/org/unicode/cldr/util//data/[tlds\-alpha\-by\-domain.txt](http://data.iana.org/TLD/tlds-alpha-by-domain.txt) - If using Eclipse, refresh the files - Diff each with the old copy to check for consistency - Certain of the steps below require that you note certain differences. @@ -65,9 +65,9 @@ title: Update Language/Script/Region Subtags - ~~Todo: fix GenerateEnums around Utility.getUTF8Data("territory\_codes.txt");~~ - Then run GenerateEnums.java, and make sure it completes with no exceptions. Fix any necessary results. - Missing alpha3 for: xx, or "In RFC 4646 but not in CLDR: \[EA, EZ, IC, UN]" - - Ignore if it is {EA, EZ, IC, UN} Otherwise means you needed to do "For new territories" above + - Ignore if it is `{EA, EZ, IC, UN}` Otherwise means you needed to do "For new territories" above - Collision with: xx - - Ignore if it is {{MM, BU, 104}, {TP, TL, 626}, {YU, CS, 891}, {ZR, CD, 180}} + - Ignore if it is `{MM, BU, 104}, {TP, TL, 626}, {YU, CS, 891}, {ZR, CD, 180}` - Not in World but in CLDR: \[002, 003, 005, 009, 011, 013, 014, 015, 017\... Ignore 3\-digit coes - (should have exception lists in tool for the Ignore's above) - Run **ConsoleCheckCLDR \-f en \-z FINAL\_TESTING \-e** @@ -79,4 +79,4 @@ title: Update Language/Script/Region Subtags - You may also have to fix the coverageLevels.txt file for an error like: - Error: (TestCoverageLevel.java:604\) Comprehensive \& no exception for path \=\> //ldml/localeDisplayNames/territories/territory\[@type\="202"] -![Unicode copyright](https://www.unicode.org/img/hb_notice.gif) \ No newline at end of file +![Unicode copyright](https://www.unicode.org/img/hb_notice.gif) From 945765b7be0a3d102ebbdb4de34bd4790dab09fe Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 4 Sep 2024 17:06:39 -0500 Subject: [PATCH 07/14] CLDR-17803 docs/site: fix content type --- docs/site/_headers | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 docs/site/_headers diff --git a/docs/site/_headers b/docs/site/_headers new file mode 100644 index 00000000000..516ed2f1318 --- /dev/null +++ b/docs/site/_headers @@ -0,0 +1,2 @@ +/node_modules/*.js + content-type: application-javascript; charset=utf-8 From 19e34f92b19be9332a2992ba0c282ef4c72b953b Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 4 Sep 2024 17:24:25 -0500 Subject: [PATCH 08/14] CLDR-17803 docs/site: workaround for content-type issue --- docs/site/_layouts/page.html | 4 +++- docs/site/package-lock.json | 1 + docs/site/package.json | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/site/_layouts/page.html b/docs/site/_layouts/page.html index 34abe8b81c8..acf9f2694bc 100644 --- a/docs/site/_layouts/page.html +++ b/docs/site/_layouts/page.html @@ -31,7 +31,9 @@
© 1991-2024 Unicode, Inc. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. See Terms of Use.
- + + + diff --git a/docs/site/package-lock.json b/docs/site/package-lock.json index 61e53a3ef3b..01a0940a8a0 100644 --- a/docs/site/package-lock.json +++ b/docs/site/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "@unicode-org/cldr-site", "version": "1.0.0", + "hasInstallScript": true, "license": "Unicode-3.0", "dependencies": { "gray-matter": "^4.0.3", diff --git a/docs/site/package.json b/docs/site/package.json index f4095933d42..d54a71d2eab 100644 --- a/docs/site/package.json +++ b/docs/site/package.json @@ -4,7 +4,8 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "build": "node assets/js/build.mjs" + "build": "node assets/js/build.mjs", + "postinstall": "cp node_modules/vue/dist/vue.global.prod.js node_modules/vue/dist/vue_global_prod.js" }, "keywords": [], "author": "Steven R. Loomis ", From 85e3172fc267a7e36f5eaa7cc6732b04205ce65b Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 4 Sep 2024 17:34:12 -0500 Subject: [PATCH 09/14] CLDR-17803 docs/site: use assets/vendor instead of node_modules --- docs/site/.gitignore | 1 + docs/site/_config.yml | 4 ---- docs/site/_layouts/page.html | 3 +-- docs/site/package.json | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/docs/site/.gitignore b/docs/site/.gitignore index 9fbbb2c6f27..f72d4052c50 100644 --- a/docs/site/.gitignore +++ b/docs/site/.gitignore @@ -1,2 +1,3 @@ /node_modules /assets/json +/assets/vendor diff --git a/docs/site/_config.yml b/docs/site/_config.yml index 65571896a21..bc499f53c14 100644 --- a/docs/site/_config.yml +++ b/docs/site/_config.yml @@ -18,7 +18,3 @@ defaults: path: '' values: layout: page - -include: - - node_modules - diff --git a/docs/site/_layouts/page.html b/docs/site/_layouts/page.html index acf9f2694bc..cd4c5d9816a 100644 --- a/docs/site/_layouts/page.html +++ b/docs/site/_layouts/page.html @@ -32,8 +32,7 @@ © 1991-2024 Unicode, Inc. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. See Terms of Use. - - + diff --git a/docs/site/package.json b/docs/site/package.json index d54a71d2eab..3eac2b7b0ac 100644 --- a/docs/site/package.json +++ b/docs/site/package.json @@ -5,7 +5,7 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "build": "node assets/js/build.mjs", - "postinstall": "cp node_modules/vue/dist/vue.global.prod.js node_modules/vue/dist/vue_global_prod.js" + "postinstall": "mkdir -p assets/vendor ; cp node_modules/vue/dist/vue.global.prod.js assets/vendor" }, "keywords": [], "author": "Steven R. Loomis ", From 86f6c19d767d79eefa7da69fd63a64c9b3c76bc6 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 4 Sep 2024 17:39:28 -0500 Subject: [PATCH 10/14] CLDR-17803 docs/site: run prettier --- docs/site/assets/js/build.mjs | 72 ++++---- docs/site/assets/js/cldrsite.js | 286 ++++++++++++++++---------------- 2 files changed, 175 insertions(+), 183 deletions(-) diff --git a/docs/site/assets/js/build.mjs b/docs/site/assets/js/build.mjs index bfd3b4e47fa..899911350bd 100644 --- a/docs/site/assets/js/build.mjs +++ b/docs/site/assets/js/build.mjs @@ -1,35 +1,33 @@ // extract site frontmatter, save to json -import * as fs from 'node:fs/promises'; -import * as path from 'node:path'; -import { default as process } from 'node:process'; -import { default as matter } from 'gray-matter'; - +import * as fs from "node:fs/promises"; +import * as path from "node:path"; +import { default as process } from "node:process"; +import { default as matter } from "gray-matter"; const SKIP_THESE = /(node_modules|\.jekyll-cache)/; - async function processFile(d, fullPath, out) { - const f = await fs.readFile(fullPath, 'utf-8'); - const m = matter(f); - if (m && m.data) { - const { data } = m; - out.all.push({ ...data, fullPath }); - } else { - out.app.push({ fullPath }); // synthesize data? - } + const f = await fs.readFile(fullPath, "utf-8"); + const m = matter(f); + if (m && m.data) { + const { data } = m; + out.all.push({ ...data, fullPath }); + } else { + out.app.push({ fullPath }); // synthesize data? + } } /** process one dirent */ async function processEntry(d, out, e) { - const fullpath = path.join(d, e.name); - if (SKIP_THESE.test(e.name)) return; - if (e.isDirectory()) { - return await traverse(fullpath, out); - } else if(!e.isFile() || !/\.md$/.test(e.name)) { - return; - } - await processFile(d, fullpath, out); + const fullpath = path.join(d, e.name); + if (SKIP_THESE.test(e.name)) return; + if (e.isDirectory()) { + return await traverse(fullpath, out); + } else if (!e.isFile() || !/\.md$/.test(e.name)) { + return; + } + await processFile(d, fullpath, out); } /** @@ -37,25 +35,25 @@ async function processEntry(d, out, e) { * @param {object} out output struct */ async function traverse(d, out) { - const dirents = await fs.readdir(d, { withFileTypes: true }); - const promises = dirents.map(e => processEntry(d, out, e)); - return Promise.all(promises); + const dirents = await fs.readdir(d, { withFileTypes: true }); + const promises = dirents.map((e) => processEntry(d, out, e)); + return Promise.all(promises); } async function main() { - const out = { - all: [], - dirs: {}, - }; - await fs.mkdir('assets/json/', { recursive: true }); - await traverse('.', out); - await fs.writeFile('assets/json/tree.json', JSON.stringify(out, null, ' ')); + const out = { + all: [], + dirs: {}, + }; + await fs.mkdir("assets/json/", { recursive: true }); + await traverse(".", out); + await fs.writeFile("assets/json/tree.json", JSON.stringify(out, null, " ")); } -main().then(() => console.log('Done.'), (e) => { +main().then( + () => console.log("Done."), + (e) => { console.error(e); process.exitCode = 1; -}); - - - + } +); diff --git a/docs/site/assets/js/cldrsite.js b/docs/site/assets/js/cldrsite.js index 623a7cbaaa2..0fbc7efc417 100644 --- a/docs/site/assets/js/cldrsite.js +++ b/docs/site/assets/js/cldrsite.js @@ -4,149 +4,152 @@ const { ref } = Vue; /** replace a/b/c.md with a/b */ function path2dir(p) { - const dir = p.split('/').slice(0,-1).join('/'); - return dir; + const dir = p.split("/").slice(0, -1).join("/"); + return dir; } /** replace a/b/c.md with a/b/c.html */ function md2html(p) { - return (p.replace(/\.md$/,'.html')); + return p.replace(/\.md$/, ".html"); } /** replace a/b/c.html with a/b/c.md */ function html2md(p) { - return (p.replace(/\.html$/,'.md')); + return p.replace(/\.html$/, ".md"); } /** load and cook the site data */ async function siteData() { - // load the json - const d = await fetch('/assets/json/tree.json'); - const j = await d.json(); - const { all } = j; - - // 'all' is an array of { title, fullPath } entries. - // Flat list of paths - const allPaths = all.map(({fullPath})=>(fullPath)); - // Find all 'directories' (ending with /) - const allDirs = new Set(); - allPaths.forEach(p => { - const segs = p.split('/').slice(0,-1); // ['', 'dir1'] - for(let n=0; n<=segs.length; n++) { - // add all parent paths, so: '', dir1, dir1/dir2 etc. - const subpath = segs.slice(0,n).join('/'); - allDirs.add(subpath); - } - }); - j.allDirs = {}; - j.allIndexes = []; - // allDirs: '', index, downloads, etc… - allDirs.forEach(dir => { - // presumed index page: /downloads -> /downloads.md - // also / -> /index.md - const dirIndex = `${dir || 'index'}.md`; - // console.dir({dir, dirIndex}); - if (allPaths.indexOf(dirIndex) !== -1) { - j.allDirs[dir] = {index: dirIndex}; - j.allIndexes.push(dirIndex); - } else { - console.error(`No index page: ${dirIndex}`); - j.allDirs[dir] = {}; - } - j.allDirs[dir].pages = []; - }); - allPaths.forEach(p => { - const dir = path2dir(p); - j.allDirs[dir].pages.push(p); - }); - // map md -> title - j.title = {}; - all.forEach(({title, fullPath}) => j.title[fullPath] = title); - return j; + // load the json + const d = await fetch("/assets/json/tree.json"); + const j = await d.json(); + const { all } = j; + + // 'all' is an array of { title, fullPath } entries. + // Flat list of paths + const allPaths = all.map(({ fullPath }) => fullPath); + // Find all 'directories' (ending with /) + const allDirs = new Set(); + allPaths.forEach((p) => { + const segs = p.split("/").slice(0, -1); // ['', 'dir1'] + for (let n = 0; n <= segs.length; n++) { + // add all parent paths, so: '', dir1, dir1/dir2 etc. + const subpath = segs.slice(0, n).join("/"); + allDirs.add(subpath); + } + }); + j.allDirs = {}; + j.allIndexes = []; + // allDirs: '', index, downloads, etc… + allDirs.forEach((dir) => { + // presumed index page: /downloads -> /downloads.md + // also / -> /index.md + const dirIndex = `${dir || "index"}.md`; + // console.dir({dir, dirIndex}); + if (allPaths.indexOf(dirIndex) !== -1) { + j.allDirs[dir] = { index: dirIndex }; + j.allIndexes.push(dirIndex); + } else { + console.error(`No index page: ${dirIndex}`); + j.allDirs[dir] = {}; + } + j.allDirs[dir].pages = []; + }); + allPaths.forEach((p) => { + const dir = path2dir(p); + j.allDirs[dir].pages.push(p); + }); + // map md -> title + j.title = {}; + all.forEach(({ title, fullPath }) => (j.title[fullPath] = title)); + return j; } - -const app = Vue.createApp({ +const app = Vue.createApp( + { setup(props) { - const tree = ref({}); - const status = ref(null); + const tree = ref({}); + const status = ref(null); - return { - tree, - status, - } + return { + tree, + status, + }; }, mounted() { - const t = this; - siteData().then(d => t.tree.value = d, e => t.status = e); + const t = this; + siteData().then( + (d) => (t.tree.value = d), + (e) => (t.status = e) + ); }, props: { - path: String, + path: String, }, computed: { - mdPath() { - if(this.path) { - return html2md(this.path) - } - return null; - }, - ourDir() { - if(this.path) { - return path2dir(this.path); - } - return ''; - }, - ourIndex() { - if(this.tree?.value) { - // first ARE we an index page? - if (this.tree.value.allIndexes.indexOf(this.mdPath) != -1) { - return this.mdPath; // we are an index - } - return this.tree.value.allDirs[this.ourDir].index; - } - return null; - }, - ourIndexHtml() { - if (this.ourIndex) { - return md2html(this.ourIndex); - } else { - return null; - } - }, - ourIndexTitle() { - if (this.ourIndex && this.tree?.value) { - return this.tree.value.title[this.ourIndex] || this.ourIndex; - } else { - return null; - } - }, - ourTitle() { - if (this.tree?.value) { - if (this.path === '') return this.rootTitle; - return this.tree.value.title[html2md(this.path)]; - } - }, - // title of root - rootTitle() { - return this.tree?.value?.title['index.md']; - }, - // list of pages for siblings of this dir - siblingPages() { - if (!this.tree?.value) return []; - const dirForPage = this.ourDir; - let thePages = this.tree?.value?.allDirs[dirForPage].pages ?? []; - if (dirForPage === '') { - thePages = [...thePages, ...this.tree?.value?.allDirs['index'].pages]; - } - const c = new Intl.Collator([]); - return ( thePages ) - .map((path) => ({ - path, - html: md2html(path), - title: this.tree.value.title[path] ?? path, - })) - .sort((a, b) => c.compare(a.title, b.title)); - }, + mdPath() { + if (this.path) { + return html2md(this.path); + } + return null; + }, + ourDir() { + if (this.path) { + return path2dir(this.path); + } + return ""; + }, + ourIndex() { + if (this.tree?.value) { + // first ARE we an index page? + if (this.tree.value.allIndexes.indexOf(this.mdPath) != -1) { + return this.mdPath; // we are an index + } + return this.tree.value.allDirs[this.ourDir].index; + } + return null; + }, + ourIndexHtml() { + if (this.ourIndex) { + return md2html(this.ourIndex); + } else { + return null; + } + }, + ourIndexTitle() { + if (this.ourIndex && this.tree?.value) { + return this.tree.value.title[this.ourIndex] || this.ourIndex; + } else { + return null; + } + }, + ourTitle() { + if (this.tree?.value) { + if (this.path === "") return this.rootTitle; + return this.tree.value.title[html2md(this.path)]; + } + }, + // title of root + rootTitle() { + return this.tree?.value?.title["index.md"]; + }, + // list of pages for siblings of this dir + siblingPages() { + if (!this.tree?.value) return []; + const dirForPage = this.ourDir; + let thePages = this.tree?.value?.allDirs[dirForPage].pages ?? []; + if (dirForPage === "") { + thePages = [...thePages, ...this.tree?.value?.allDirs["index"].pages]; + } + const c = new Intl.Collator([]); + return thePages + .map((path) => ({ + path, + html: md2html(path), + title: this.tree.value.title[path] ?? path, + })) + .sort((a, b) => c.compare(a.title, b.title)); + }, }, template: `
{{ status }}
@@ -174,34 +177,25 @@ const app = Vue.createApp({ -
` -}, { + `, + }, + { // path of / goes to /index.html - path: (window.location.pathname.slice(1) || 'index.html'), -}); - -app.component( - 'CldrPage', - { - setup() { - - }, - template: `

Hello

- ` - } + path: window.location.pathname.slice(1) || "index.html", + } ); -app.component( - 'CldrList', - { - setup() { +app.component("CldrPage", { + setup() {}, + template: `

Hello

+ `, +}); - }, - template: ` +app.component("CldrList", { + setup() {}, + template: `

Hullo

- ` - } -); - + `, +}); -app.mount('#nav'); +app.mount("#nav"); From 6d8e47d5e415b3ab3985c655a2978a62fea1fc16 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 4 Sep 2024 17:52:10 -0500 Subject: [PATCH 11/14] CLDR-17803 docs/site: child links - can now 'descend' into subdirectories (sub indices) - fix yet another missing .md file --- docs/site/assets/js/cldrsite.js | 32 ++++++++++++++-------- docs/site/development/coding-cldr-tools.md | 5 ++++ 2 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 docs/site/development/coding-cldr-tools.md diff --git a/docs/site/assets/js/cldrsite.js b/docs/site/assets/js/cldrsite.js index 0fbc7efc417..f8cdef6362f 100644 --- a/docs/site/assets/js/cldrsite.js +++ b/docs/site/assets/js/cldrsite.js @@ -136,7 +136,15 @@ const app = Vue.createApp( // list of pages for siblings of this dir siblingPages() { if (!this.tree?.value) return []; - const dirForPage = this.ourDir; + let dirForPage = this.ourDir; + if (this.tree.value.allIndexes.indexOf(this.mdPath) != -1) { + const dirPages = Object.entries(this.tree?.value?.allDirs) + .filter(([k, {index}]) => index == this.mdPath)[0]; + if (dirPages) { + // our page is an index -so, show the subpages instead of the siblings. + dirForPage = dirPages[0]; // the adjusted index + } + } let thePages = this.tree?.value?.allDirs[dirForPage].pages ?? []; if (dirForPage === "") { thePages = [...thePages, ...this.tree?.value?.allDirs["index"].pages]; @@ -185,17 +193,17 @@ const app = Vue.createApp( } ); -app.component("CldrPage", { - setup() {}, - template: `

Hello

- `, -}); +// app.component("CldrPage", { +// setup() {}, +// template: `

Hello

+// `, +// }); -app.component("CldrList", { - setup() {}, - template: ` -

Hullo

- `, -}); +// app.component("CldrList", { +// setup() {}, +// template: ` +//

Hullo

+// `, +// }); app.mount("#nav"); diff --git a/docs/site/development/coding-cldr-tools.md b/docs/site/development/coding-cldr-tools.md new file mode 100644 index 00000000000..d5af3a51403 --- /dev/null +++ b/docs/site/development/coding-cldr-tools.md @@ -0,0 +1,5 @@ +--- +title: "Coding CLDR Tools" +--- + +Pages concerning coding CLDR Tools From 02b41bd90011e2006e79f67e268b41375b3513c4 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 4 Sep 2024 17:59:28 -0500 Subject: [PATCH 12/14] CLDR-17803 docs/site: re-add .html in internal path --- docs/site/assets/js/cldrsite.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/site/assets/js/cldrsite.js b/docs/site/assets/js/cldrsite.js index f8cdef6362f..fbfac161684 100644 --- a/docs/site/assets/js/cldrsite.js +++ b/docs/site/assets/js/cldrsite.js @@ -2,6 +2,11 @@ const { ref } = Vue; // site management +let myPath = window.location.pathname.slice(1) || "index.html" +if (!/\.html/.test(myPath)) { + myPath = `${myPath}.html`; // cloudflare likes to drop the .html +} + /** replace a/b/c.md with a/b */ function path2dir(p) { const dir = p.split("/").slice(0, -1).join("/"); @@ -189,7 +194,7 @@ const app = Vue.createApp( }, { // path of / goes to /index.html - path: window.location.pathname.slice(1) || "index.html", + path: myPath, } ); From 0b61c98bff93ec44d5507666013163cdbf8c6fd7 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 4 Sep 2024 18:02:39 -0500 Subject: [PATCH 13/14] CLDR-17803 docs/site: highlight current page --- docs/site/assets/css/page.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/site/assets/css/page.css b/docs/site/assets/css/page.css index 2c6a3403a17..8fef6bdf28a 100644 --- a/docs/site/assets/css/page.css +++ b/docs/site/assets/css/page.css @@ -34,6 +34,10 @@ header .nav a, header .nav .title { color: white; } +header .nav ul b { + color: yellow; +} + footer { width: 100%; margin-left: auto; From f0bf637254bdd7882b39681c876863f7f2395f8c Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 4 Sep 2024 19:59:25 -0500 Subject: [PATCH 14/14] CLDR-17803 Actualizar page.html --- docs/site/_layouts/page.html | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/site/_layouts/page.html b/docs/site/_layouts/page.html index cd4c5d9816a..5961ee550f1 100644 --- a/docs/site/_layouts/page.html +++ b/docs/site/_layouts/page.html @@ -18,6 +18,7 @@ + This navigation UI is temporary, just to give access to the pages.