diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 3347014e..e67c2e5a 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -235,7 +235,7 @@ const config: Config = { themeConfig: /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ { - image: "img/socialgraph_twitter.png", + image: "img/og/miden-docs.png", metadata: [ { name: "twitter:card", content: "summary_large_image" }, { name: "twitter:site", content: "@0xMiden" }, diff --git a/package-lock.json b/package-lock.json index 9ca2850d..316386ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "@docusaurus/tsconfig": "3.8.1", "@docusaurus/types": "3.8.1", "@types/turndown": "^5.0.6", + "sharp": "^0.34.5", "typescript": "~5.6.2" }, "engines": { @@ -3950,6 +3951,17 @@ "node": ">=18.0" } }, + "node_modules/@emnapi/runtime": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", + "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@hapi/hoek": { "version": "9.3.0", "license": "BSD-3-Clause" @@ -3983,6 +3995,496 @@ "mlly": "^1.7.4" } }, + "node_modules/@img/colour": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", + "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz", + "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz", + "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz", + "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz", + "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz", + "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz", + "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz", + "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz", + "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz", + "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz", + "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz", + "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz", + "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz", + "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz", + "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz", + "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz", + "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-riscv64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz", + "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz", + "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz", + "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz", + "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz", + "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.7.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz", + "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz", + "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz", + "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, "node_modules/@jest/schemas": { "version": "29.6.3", "license": "MIT", @@ -7519,6 +8021,16 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, "node_modules/detect-node": { "version": "2.1.0", "license": "MIT" @@ -14342,6 +14854,64 @@ "version": "1.1.0", "license": "MIT" }, + "node_modules/sharp": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz", + "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.0.0", + "detect-libc": "^2.1.2", + "semver": "^7.7.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.34.5", + "@img/sharp-darwin-x64": "0.34.5", + "@img/sharp-libvips-darwin-arm64": "1.2.4", + "@img/sharp-libvips-darwin-x64": "1.2.4", + "@img/sharp-libvips-linux-arm": "1.2.4", + "@img/sharp-libvips-linux-arm64": "1.2.4", + "@img/sharp-libvips-linux-ppc64": "1.2.4", + "@img/sharp-libvips-linux-riscv64": "1.2.4", + "@img/sharp-libvips-linux-s390x": "1.2.4", + "@img/sharp-libvips-linux-x64": "1.2.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", + "@img/sharp-libvips-linuxmusl-x64": "1.2.4", + "@img/sharp-linux-arm": "0.34.5", + "@img/sharp-linux-arm64": "0.34.5", + "@img/sharp-linux-ppc64": "0.34.5", + "@img/sharp-linux-riscv64": "0.34.5", + "@img/sharp-linux-s390x": "0.34.5", + "@img/sharp-linux-x64": "0.34.5", + "@img/sharp-linuxmusl-arm64": "0.34.5", + "@img/sharp-linuxmusl-x64": "0.34.5", + "@img/sharp-wasm32": "0.34.5", + "@img/sharp-win32-arm64": "0.34.5", + "@img/sharp-win32-ia32": "0.34.5", + "@img/sharp-win32-x64": "0.34.5" + } + }, + "node_modules/sharp/node_modules/semver": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.0.tgz", + "integrity": "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "license": "MIT", diff --git a/package.json b/package.json index 38a272fa..ea62f4ec 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "deploy": "docusaurus deploy", "clear": "docusaurus clear", "serve": "docusaurus serve", + "generate:og": "node scripts/generate-og-images.mjs", "write-translations": "docusaurus write-translations", "write-heading-ids": "docusaurus write-heading-ids", "typecheck": "tsc" @@ -34,6 +35,7 @@ "@docusaurus/tsconfig": "3.8.1", "@docusaurus/types": "3.8.1", "@types/turndown": "^5.0.6", + "sharp": "^0.34.5", "typescript": "~5.6.2" }, "browserslist": { diff --git a/scripts/generate-og-images.mjs b/scripts/generate-og-images.mjs new file mode 100644 index 00000000..46ed9e4e --- /dev/null +++ b/scripts/generate-og-images.mjs @@ -0,0 +1,462 @@ +import { mkdir } from "node:fs/promises"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import sharp from "sharp"; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const rootDir = path.resolve(__dirname, ".."); +const outputDir = path.join(rootDir, "static", "img", "og"); + +const width = 1200; +const height = 630; + +const images = [ + { + id: "miden-docs", + eyebrow: "Miden Docs", + title: "Miden Docs", + description: "Documentation for building, integrating, and understanding Miden.", + accent: "#ff5500", + panel: "DOCS", + }, + { + id: "build", + eyebrow: "Build", + title: "Build on Miden", + description: "Start building private, verifiable applications on the Miden rollup.", + accent: "#ff5500", + panel: "BUILD", + }, + { + id: "get-started", + eyebrow: "Build", + title: "Get Started", + description: "Install the tools, create accounts, move notes, and read account state.", + accent: "#ff5500", + panel: "START", + }, + { + id: "first-smart-contract", + eyebrow: "Get Started", + title: "Your First Smart Contract", + description: "Create, test, and deploy a minimal Miden account component.", + accent: "#ff5500", + panel: "FIRST", + }, + { + id: "smart-contracts", + eyebrow: "Build", + title: "Smart Contracts", + description: "Write Miden account logic and notes in Rust or MASM.", + accent: "#ff5500", + panel: "CONTRACT", + }, + { + id: "smart-contract-accounts", + eyebrow: "Smart Contracts", + title: "Accounts", + description: "Account components, storage, authentication, and account operations.", + accent: "#ff5500", + panel: "ACCOUNTS", + }, + { + id: "smart-contract-notes", + eyebrow: "Smart Contracts", + title: "Notes", + description: "Programmable messages that carry assets, scripts, and execution context.", + accent: "#ff5500", + panel: "NOTES", + }, + { + id: "smart-contract-transactions", + eyebrow: "Smart Contracts", + title: "Transactions", + description: "Scripts, context, advice data, and execution patterns on Miden.", + accent: "#ff5500", + panel: "TX", + }, + { + id: "tutorials", + eyebrow: "Build", + title: "Tutorials", + description: "Runnable walkthroughs for client apps, contracts, and local development.", + accent: "#ff5500", + panel: "RUN", + }, + { + id: "miden-bank", + eyebrow: "Tutorials", + title: "Miden Bank", + description: "A complete contract tutorial covering components, notes, and flows.", + accent: "#ff5500", + panel: "BANK", + }, + { + id: "rust-recipes", + eyebrow: "Recipes", + title: "Rust Recipes", + description: "Runnable Rust client examples for common Miden development flows.", + accent: "#ff5500", + panel: "RUST", + }, + { + id: "typescript-recipes", + eyebrow: "Recipes", + title: "TypeScript Recipes", + description: "Browser and React examples for Miden applications.", + accent: "#ff5500", + panel: "TS", + }, + { + id: "tools", + eyebrow: "Build", + title: "Tools", + description: "Clients, SDKs, CLIs, transport services, and development utilities.", + accent: "#ff5500", + panel: "TOOLS", + }, + { + id: "clients", + eyebrow: "Tools", + title: "Clients", + description: "Rust, TypeScript, and React interfaces for Miden applications.", + accent: "#ff5500", + panel: "CLIENT", + }, + { + id: "react-sdk", + eyebrow: "Clients", + title: "React SDK", + description: "Hooks and provider patterns for browser-based Miden applications.", + accent: "#ff5500", + panel: "REACT", + }, + { + id: "rust-client", + eyebrow: "Clients", + title: "Rust Client", + description: "Programmatic accounts, notes, transactions, and local client state.", + accent: "#ff5500", + panel: "RUST", + }, + { + id: "rust-client-get-started", + eyebrow: "Rust Client", + title: "Get Started", + description: "Create accounts, use faucets, and move assets with the Rust client.", + accent: "#ff5500", + panel: "RUST", + }, + { + id: "rust-client-cli", + eyebrow: "Rust Client", + title: "CLI", + description: "Configure and operate the Miden client command-line interface.", + accent: "#ff5500", + panel: "CLI", + }, + { + id: "typescript-client", + eyebrow: "Clients", + title: "TypeScript Client", + description: "Browser and React flows for Miden apps using the TypeScript SDK.", + accent: "#ff5500", + panel: "TS", + }, + { + id: "note-transport", + eyebrow: "Tools", + title: "Note Transport", + description: "Transport public notes across clients without taking custody of assets.", + accent: "#ff5500", + panel: "NOTES", + }, + { + id: "miden-guardian", + eyebrow: "Build", + title: "Miden Guardian", + description: "Assisted self-custody flows for safer account recovery and operation.", + accent: "#ff5500", + panel: "GUARD", + }, + { + id: "private-multisig", + eyebrow: "Build", + title: "Private Multisig", + description: "Account patterns for private approvals and coordinated execution.", + accent: "#ff5500", + panel: "MULTI", + }, + { + id: "migration", + eyebrow: "Build", + title: "Migration", + description: "Version-to-version changes for Miden builders and client integrations.", + accent: "#ff5500", + panel: "MIGRATE", + }, + { + id: "reference", + eyebrow: "Build", + title: "Reference", + description: "Glossary, FAQ, and supporting reference material for Miden builders.", + accent: "#ff5500", + panel: "REF", + }, + { + id: "core-concepts", + eyebrow: "Core Concepts", + title: "Core Concepts", + description: "Technical foundations for the protocol, node, VM, and compiler.", + accent: "#ff5500", + panel: "SPEC", + }, + { + id: "protocol", + eyebrow: "Core Concepts", + title: "Protocol", + description: "Accounts, notes, transactions, proving, and state transition rules.", + accent: "#ff5500", + panel: "PROTO", + }, + { + id: "protocol-accounts", + eyebrow: "Protocol", + title: "Accounts", + description: "Account identifiers, code, storage, vaults, and authentication rules.", + accent: "#ff5500", + panel: "ACCOUNT", + }, + { + id: "node", + eyebrow: "Core Concepts", + title: "Node", + description: "Network components, transaction flow, block production, and sync.", + accent: "#ff5500", + panel: "NODE", + }, + { + id: "node-operator", + eyebrow: "Node", + title: "Operator Guide", + description: "Run, configure, and observe Miden node infrastructure.", + accent: "#ff5500", + panel: "OPS", + }, + { + id: "miden-vm", + eyebrow: "Core Concepts", + title: "Miden VM", + description: "The STARK-based virtual machine that executes Miden programs.", + accent: "#ff5500", + panel: "VM", + }, + { + id: "vm-user-docs", + eyebrow: "Miden VM", + title: "User Docs", + description: "Assembly, standard libraries, debugging, and VM-facing developer flows.", + accent: "#ff5500", + panel: "VM", + }, + { + id: "miden-assembly", + eyebrow: "Miden VM", + title: "Miden Assembly", + description: "Instruction-level programming and MASM module structure.", + accent: "#ff5500", + panel: "MASM", + }, + { + id: "core-library", + eyebrow: "Miden VM", + title: "Core Library", + description: "Standard MASM modules and reusable VM procedures.", + accent: "#ff5500", + panel: "LIB", + }, + { + id: "vm-design", + eyebrow: "Miden VM", + title: "VM Design", + description: "Execution traces, stack model, chiplets, lookups, and constraints.", + accent: "#ff5500", + panel: "TRACE", + }, + { + id: "vm-stack", + eyebrow: "Miden VM", + title: "Stack", + description: "Operand stack semantics, execution state, and stack constraints.", + accent: "#ff5500", + panel: "STACK", + }, + { + id: "compiler", + eyebrow: "Core Concepts", + title: "Compiler", + description: "Compile Rust components into Miden Assembly and executable artifacts.", + accent: "#ff5500", + panel: "MIDENC", + }, + { + id: "compiler-usage", + eyebrow: "Compiler", + title: "Usage", + description: "Compile, inspect, and integrate Rust components with midenc.", + accent: "#ff5500", + panel: "USE", + }, + { + id: "compiler-guides", + eyebrow: "Compiler", + title: "Guides", + description: "Practical compiler workflows for Miden builders.", + accent: "#ff5500", + panel: "GUIDE", + }, + { + id: "compiler-appendix", + eyebrow: "Compiler", + title: "Appendix", + description: "Compiler reference material and lower-level implementation details.", + accent: "#ff5500", + panel: "APPENDIX", + }, +]; + +function escapeHtml(value) { + return value + .replaceAll("&", "&") + .replaceAll("<", "<") + .replaceAll(">", ">") + .replaceAll('"', """); +} + +function titleLines(title) { + if (title.length <= 17) { + return [title]; + } + + const words = title.split(" "); + const lines = []; + let current = ""; + + for (const word of words) { + const candidate = current ? `${current} ${word}` : word; + if (candidate.length > 17 && current) { + lines.push(current); + current = word; + } else { + current = candidate; + } + } + + if (current) { + lines.push(current); + } + + return lines.slice(0, 2); +} + +function wrapText(text, maxLength, maxLines = 3) { + const words = text.split(" "); + const lines = []; + let current = ""; + + for (const word of words) { + const candidate = current ? `${current} ${word}` : word; + if (candidate.length > maxLength && current) { + lines.push(current); + current = word; + } else { + current = candidate; + } + } + + if (current) { + lines.push(current); + } + + if (lines.length <= maxLines) { + return lines; + } + + const visibleLines = lines.slice(0, maxLines); + const lastLine = visibleLines[maxLines - 1]; + visibleLines[maxLines - 1] = + lastLine.length > maxLength - 1 + ? `${lastLine.slice(0, maxLength - 1)}...` + : `${lastLine}...`; + + return visibleLines; +} + +function svgFor(image) { + const [lineOne, lineTwo] = titleLines(image.title); + const descriptionLines = wrapText(image.description, 38, 3); + const hasSecondLine = Boolean(lineTwo); + const titleOneY = hasSecondLine ? 254 : 284; + const titleTwoY = 324; + const descriptionY = hasSecondLine ? 382 : 356; + const ctaY = hasSecondLine ? 492 : 472; + const badgeWidth = Math.max(150, Math.min(270, image.eyebrow.length * 12 + 48)); + const escapedTitleOne = escapeHtml(lineOne); + const escapedTitleTwo = lineTwo ? escapeHtml(lineTwo) : ""; + const descriptionSvg = descriptionLines + .map( + (line, index) => + `${escapeHtml(line)}`, + ) + .join("\n "); + + return ` + + + + + + + + + + + + + + + + + + + + + + + + Miden Docs + ${escapeHtml(image.panel)} + + ${escapeHtml(image.eyebrow.toUpperCase())} + ${escapedTitleOne} + ${hasSecondLine ? `${escapedTitleTwo}` : ""} + ${descriptionSvg} + + READ THE DOCS + docs.miden.xyz + + + + + +`; +} + +await mkdir(outputDir, { recursive: true }); + +for (const image of images) { + const svg = svgFor(image); + await sharp(Buffer.from(svg)).png().toFile(path.join(outputDir, `${image.id}.png`)); +} + +console.log(`Generated ${images.length} OG PNGs in ${path.relative(rootDir, outputDir)}`); diff --git a/src/theme/DocCategoryGeneratedIndexPage/index.tsx b/src/theme/DocCategoryGeneratedIndexPage/index.tsx new file mode 100644 index 00000000..92fece5c --- /dev/null +++ b/src/theme/DocCategoryGeneratedIndexPage/index.tsx @@ -0,0 +1,28 @@ +import React, { type ReactNode } from "react"; +import { PageMetadata } from "@docusaurus/theme-common"; +import OriginalDocCategoryGeneratedIndexPage from "@theme-original/DocCategoryGeneratedIndexPage"; +import type { Props } from "@theme/DocCategoryGeneratedIndexPage"; +import { getDocOgDescription, getDocOgImage } from "../../utils/ogImages"; + +export default function DocCategoryGeneratedIndexPage(props: Props): ReactNode { + const image = + props.categoryGeneratedIndex.image ?? + getDocOgImage(props.categoryGeneratedIndex.permalink); + const description = + props.categoryGeneratedIndex.description ?? + getDocOgDescription(props.categoryGeneratedIndex.permalink); + + return ( + <> + + + + + + + + ); +} diff --git a/src/theme/DocItem/Metadata/index.tsx b/src/theme/DocItem/Metadata/index.tsx new file mode 100644 index 00000000..8367048c --- /dev/null +++ b/src/theme/DocItem/Metadata/index.tsx @@ -0,0 +1,23 @@ +import React, { type ReactNode } from "react"; +import { PageMetadata } from "@docusaurus/theme-common"; +import { useDoc } from "@docusaurus/plugin-content-docs/client"; +import { getDocOgDescription, getDocOgImage } from "../../../utils/ogImages"; + +export default function DocItemMetadata(): ReactNode { + const { metadata, frontMatter, assets } = useDoc(); + const image = assets.image ?? frontMatter.image ?? getDocOgImage(metadata.permalink); + const description = metadata.description || getDocOgDescription(metadata.permalink); + + return ( + + + + + + ); +} diff --git a/src/utils/ogImages.ts b/src/utils/ogImages.ts new file mode 100644 index 00000000..6b76e7e5 --- /dev/null +++ b/src/utils/ogImages.ts @@ -0,0 +1,376 @@ +const OG_IMAGE_ROOT = "img/og"; +const DEFAULT_OG_IMAGE = `${OG_IMAGE_ROOT}/miden-docs.png`; + +type OgImageRule = { + pathPrefix: string; + image: string; + description: string; +}; + +const OG_IMAGE_RULES: OgImageRule[] = [ + { + pathPrefix: "/builder/get-started/your-first-smart-contract", + image: "first-smart-contract.png", + description: "Create, test, and deploy a minimal Miden account component.", + }, + { + pathPrefix: "/builder/tools/clients/react-sdk", + image: "react-sdk.png", + description: "Hooks and provider patterns for browser-based Miden applications.", + }, + { + pathPrefix: "/builder/tools/clients/rust-client/get-started", + image: "rust-client-get-started.png", + description: "Create accounts, use faucets, and move assets with the Rust client.", + }, + { + pathPrefix: "/builder/tools/clients/rust-client/cli", + image: "rust-client-cli.png", + description: "Configure and operate the Miden client command-line interface.", + }, + { + pathPrefix: "/builder/tools/clients/rust-client", + image: "rust-client.png", + description: "Programmatic accounts, notes, transactions, and local client state.", + }, + { + pathPrefix: "/builder/tools/clients/web-client", + image: "typescript-client.png", + description: "Browser and React flows for Miden apps using the TypeScript SDK.", + }, + { + pathPrefix: "/builder/tutorials/miden-bank", + image: "miden-bank.png", + description: "A complete contract tutorial covering components, notes, and flows.", + }, + { + pathPrefix: "/builder/tutorials/recipes/web", + image: "typescript-recipes.png", + description: "Browser and React examples for Miden applications.", + }, + { + pathPrefix: "/builder/tutorials/recipes/rust", + image: "rust-recipes.png", + description: "Runnable Rust client examples for common Miden development flows.", + }, + { + pathPrefix: "/builder/tools/clients", + image: "clients.png", + description: "Rust, TypeScript, and React interfaces for Miden applications.", + }, + { + pathPrefix: "/builder/tools/note-transport", + image: "note-transport.png", + description: "Transport public notes across clients without taking custody of assets.", + }, + { + pathPrefix: "/builder/tools", + image: "tools.png", + description: "Clients, SDKs, CLIs, transport services, and development utilities.", + }, + { + pathPrefix: "/builder/miden-guardian", + image: "miden-guardian.png", + description: "Assisted self-custody flows for safer account recovery and operation.", + }, + { + pathPrefix: "/builder/private-multisig", + image: "private-multisig.png", + description: "Account patterns for private approvals and coordinated execution.", + }, + { + pathPrefix: "/builder/smart-contracts/accounts", + image: "smart-contract-accounts.png", + description: "Account components, storage, authentication, and account operations.", + }, + { + pathPrefix: "/builder/smart-contracts/notes", + image: "smart-contract-notes.png", + description: "Programmable messages that carry assets, scripts, and execution context.", + }, + { + pathPrefix: "/builder/smart-contracts/transactions", + image: "smart-contract-transactions.png", + description: "Scripts, context, advice data, and execution patterns on Miden.", + }, + { + pathPrefix: "/builder/smart-contracts", + image: "smart-contracts.png", + description: "Write Miden account logic and notes in Rust or MASM.", + }, + { + pathPrefix: "/builder/tutorials", + image: "tutorials.png", + description: "Runnable walkthroughs for client apps, contracts, and local development.", + }, + { + pathPrefix: "/builder/get-started", + image: "get-started.png", + description: "Install the tools, create accounts, move notes, and read account state.", + }, + { + pathPrefix: "/builder/migration", + image: "migration.png", + description: "Version-to-version changes for Miden builders and client integrations.", + }, + { + pathPrefix: "/builder/glossary", + image: "reference.png", + description: "Glossary, FAQ, and supporting reference material for Miden builders.", + }, + { + pathPrefix: "/builder/faq", + image: "reference.png", + description: "Glossary, FAQ, and supporting reference material for Miden builders.", + }, + { + pathPrefix: "/builder", + image: "build.png", + description: "Start building private, verifiable applications on the Miden rollup.", + }, + { + pathPrefix: "/core-concepts/protocol/account", + image: "protocol-accounts.png", + description: "Account identifiers, code, storage, vaults, and authentication rules.", + }, + { + pathPrefix: "/core-concepts/protocol", + image: "protocol.png", + description: "Accounts, notes, transactions, proving, and state transition rules.", + }, + { + pathPrefix: "/core-concepts/miden-base/account", + image: "protocol-accounts.png", + description: "Account identifiers, code, storage, vaults, and authentication rules.", + }, + { + pathPrefix: "/core-concepts/miden-base", + image: "protocol.png", + description: "Accounts, notes, transactions, proving, and state transition rules.", + }, + { + pathPrefix: "/core-concepts/node/operator", + image: "node-operator.png", + description: "Run, configure, and observe Miden node infrastructure.", + }, + { + pathPrefix: "/core-concepts/node", + image: "node.png", + description: "Network components, transaction flow, block production, and sync.", + }, + { + pathPrefix: "/core-concepts/miden-node/operator", + image: "node-operator.png", + description: "Run, configure, and observe Miden node infrastructure.", + }, + { + pathPrefix: "/core-concepts/miden-node", + image: "node.png", + description: "Network components, transaction flow, block production, and sync.", + }, + { + pathPrefix: "/core-concepts/miden-vm/user_docs/assembly", + image: "miden-assembly.png", + description: "Instruction-level programming and MASM module structure.", + }, + { + pathPrefix: "/core-concepts/miden-vm/user_docs/core_lib", + image: "core-library.png", + description: "Standard MASM modules and reusable VM procedures.", + }, + { + pathPrefix: "/core-concepts/miden-vm/user_docs", + image: "vm-user-docs.png", + description: "Assembly, standard libraries, debugging, and VM-facing developer flows.", + }, + { + pathPrefix: "/core-concepts/miden-vm/design/stack", + image: "vm-stack.png", + description: "Operand stack semantics, execution state, and stack constraints.", + }, + { + pathPrefix: "/core-concepts/miden-vm/design", + image: "vm-design.png", + description: "Execution traces, stack model, chiplets, lookups, and constraints.", + }, + { + pathPrefix: "/core-concepts/miden-vm", + image: "miden-vm.png", + description: "The STARK-based virtual machine that executes Miden programs.", + }, + { + pathPrefix: "/core-concepts/compiler/usage", + image: "compiler-usage.png", + description: "Compile, inspect, and integrate Rust components with midenc.", + }, + { + pathPrefix: "/core-concepts/compiler/guides", + image: "compiler-guides.png", + description: "Practical compiler workflows for Miden builders.", + }, + { + pathPrefix: "/core-concepts/compiler/appendix", + image: "compiler-appendix.png", + description: "Compiler reference material and lower-level implementation details.", + }, + { + pathPrefix: "/core-concepts/compiler", + image: "compiler.png", + description: "Compile Rust components into Miden Assembly and executable artifacts.", + }, + { + pathPrefix: "/core-concepts", + image: "core-concepts.png", + description: "Technical foundations for the protocol, node, VM, and compiler.", + }, + { + pathPrefix: "/quick-start/your-first-smart-contract", + image: "first-smart-contract.png", + description: "Create, test, and deploy a minimal Miden account component.", + }, + { + pathPrefix: "/quick-start", + image: "get-started.png", + description: "Install the tools, create accounts, move notes, and read account state.", + }, + { + pathPrefix: "/miden-client/rust-client", + image: "rust-client.png", + description: "Programmatic accounts, notes, transactions, and local client state.", + }, + { + pathPrefix: "/miden-client/web-client", + image: "typescript-client.png", + description: "Browser and React flows for Miden apps using the TypeScript SDK.", + }, + { + pathPrefix: "/miden-client", + image: "clients.png", + description: "Rust, TypeScript, and React interfaces for Miden applications.", + }, + { + pathPrefix: "/miden-tutorials/rust-client", + image: "rust-recipes.png", + description: "Runnable Rust client examples for common Miden development flows.", + }, + { + pathPrefix: "/miden-tutorials/web-client", + image: "typescript-recipes.png", + description: "Browser and React examples for Miden applications.", + }, + { + pathPrefix: "/miden-tutorials", + image: "tutorials.png", + description: "Runnable walkthroughs for client apps, contracts, and local development.", + }, + { + pathPrefix: "/miden-base/account", + image: "protocol-accounts.png", + description: "Account identifiers, code, storage, vaults, and authentication rules.", + }, + { + pathPrefix: "/miden-base", + image: "protocol.png", + description: "Accounts, notes, transactions, proving, and state transition rules.", + }, + { + pathPrefix: "/miden-node/operator", + image: "node-operator.png", + description: "Run, configure, and observe Miden node infrastructure.", + }, + { + pathPrefix: "/miden-node", + image: "node.png", + description: "Network components, transaction flow, block production, and sync.", + }, + { + pathPrefix: "/miden-vm/user_docs/assembly", + image: "miden-assembly.png", + description: "Instruction-level programming and MASM module structure.", + }, + { + pathPrefix: "/miden-vm/user_docs/core_lib", + image: "core-library.png", + description: "Standard MASM modules and reusable VM procedures.", + }, + { + pathPrefix: "/miden-vm/user_docs", + image: "vm-user-docs.png", + description: "Assembly, standard libraries, debugging, and VM-facing developer flows.", + }, + { + pathPrefix: "/miden-vm/design/stack", + image: "vm-stack.png", + description: "Operand stack semantics, execution state, and stack constraints.", + }, + { + pathPrefix: "/miden-vm/design", + image: "vm-design.png", + description: "Execution traces, stack model, chiplets, lookups, and constraints.", + }, + { + pathPrefix: "/miden-vm", + image: "miden-vm.png", + description: "The STARK-based virtual machine that executes Miden programs.", + }, + { + pathPrefix: "/compiler/usage", + image: "compiler-usage.png", + description: "Compile, inspect, and integrate Rust components with midenc.", + }, + { + pathPrefix: "/compiler/guides", + image: "compiler-guides.png", + description: "Practical compiler workflows for Miden builders.", + }, + { + pathPrefix: "/compiler/appendix", + image: "compiler-appendix.png", + description: "Compiler reference material and lower-level implementation details.", + }, + { + pathPrefix: "/compiler", + image: "compiler.png", + description: "Compile Rust components into Miden Assembly and executable artifacts.", + }, +]; + +function normalizeDocPath(permalink: string): string { + const pathname = permalink.startsWith("http") + ? new URL(permalink).pathname + : permalink; + const withoutTrailingSlash = pathname.replace(/\/+$/, "") || "/"; + + const withoutVersionPrefix = withoutTrailingSlash.replace( + /^\/(?:next|\d+\.\d+)(?=\/|$)/, + "", + ); + + if (withoutVersionPrefix) { + return withoutVersionPrefix; + } + + return "/"; +} + +function matchesPathPrefix(pathname: string, prefix: string): boolean { + return pathname === prefix || pathname.startsWith(`${prefix}/`); +} + +export function getDocOgImage(permalink: string): string { + const normalizedPath = normalizeDocPath(permalink); + const rule = OG_IMAGE_RULES.find(({ pathPrefix }) => + matchesPathPrefix(normalizedPath, pathPrefix), + ); + + return rule ? `${OG_IMAGE_ROOT}/${rule.image}` : DEFAULT_OG_IMAGE; +} + +export function getDocOgDescription(permalink: string): string { + const normalizedPath = normalizeDocPath(permalink); + const rule = OG_IMAGE_RULES.find(({ pathPrefix }) => + matchesPathPrefix(normalizedPath, pathPrefix), + ); + + return rule?.description ?? "Documentation for building, integrating, and understanding Miden."; +} diff --git a/static/img/og/build.png b/static/img/og/build.png new file mode 100644 index 00000000..677c740c Binary files /dev/null and b/static/img/og/build.png differ diff --git a/static/img/og/clients.png b/static/img/og/clients.png new file mode 100644 index 00000000..cba70957 Binary files /dev/null and b/static/img/og/clients.png differ diff --git a/static/img/og/compiler-appendix.png b/static/img/og/compiler-appendix.png new file mode 100644 index 00000000..d6f85add Binary files /dev/null and b/static/img/og/compiler-appendix.png differ diff --git a/static/img/og/compiler-guides.png b/static/img/og/compiler-guides.png new file mode 100644 index 00000000..2dab3996 Binary files /dev/null and b/static/img/og/compiler-guides.png differ diff --git a/static/img/og/compiler-usage.png b/static/img/og/compiler-usage.png new file mode 100644 index 00000000..387b56c5 Binary files /dev/null and b/static/img/og/compiler-usage.png differ diff --git a/static/img/og/compiler.png b/static/img/og/compiler.png new file mode 100644 index 00000000..d73b8517 Binary files /dev/null and b/static/img/og/compiler.png differ diff --git a/static/img/og/core-concepts.png b/static/img/og/core-concepts.png new file mode 100644 index 00000000..c9b0867b Binary files /dev/null and b/static/img/og/core-concepts.png differ diff --git a/static/img/og/core-library.png b/static/img/og/core-library.png new file mode 100644 index 00000000..95909d5c Binary files /dev/null and b/static/img/og/core-library.png differ diff --git a/static/img/og/first-smart-contract.png b/static/img/og/first-smart-contract.png new file mode 100644 index 00000000..be7db287 Binary files /dev/null and b/static/img/og/first-smart-contract.png differ diff --git a/static/img/og/get-started.png b/static/img/og/get-started.png new file mode 100644 index 00000000..c4c696d2 Binary files /dev/null and b/static/img/og/get-started.png differ diff --git a/static/img/og/miden-assembly.png b/static/img/og/miden-assembly.png new file mode 100644 index 00000000..9bcf7161 Binary files /dev/null and b/static/img/og/miden-assembly.png differ diff --git a/static/img/og/miden-bank.png b/static/img/og/miden-bank.png new file mode 100644 index 00000000..0ba05f0c Binary files /dev/null and b/static/img/og/miden-bank.png differ diff --git a/static/img/og/miden-docs.png b/static/img/og/miden-docs.png new file mode 100644 index 00000000..a6847b4a Binary files /dev/null and b/static/img/og/miden-docs.png differ diff --git a/static/img/og/miden-guardian.png b/static/img/og/miden-guardian.png new file mode 100644 index 00000000..808904bb Binary files /dev/null and b/static/img/og/miden-guardian.png differ diff --git a/static/img/og/miden-vm.png b/static/img/og/miden-vm.png new file mode 100644 index 00000000..63effc15 Binary files /dev/null and b/static/img/og/miden-vm.png differ diff --git a/static/img/og/migration.png b/static/img/og/migration.png new file mode 100644 index 00000000..b2c6f262 Binary files /dev/null and b/static/img/og/migration.png differ diff --git a/static/img/og/node-operator.png b/static/img/og/node-operator.png new file mode 100644 index 00000000..add152f3 Binary files /dev/null and b/static/img/og/node-operator.png differ diff --git a/static/img/og/node.png b/static/img/og/node.png new file mode 100644 index 00000000..14a63c0e Binary files /dev/null and b/static/img/og/node.png differ diff --git a/static/img/og/note-transport.png b/static/img/og/note-transport.png new file mode 100644 index 00000000..2a8f9409 Binary files /dev/null and b/static/img/og/note-transport.png differ diff --git a/static/img/og/private-multisig.png b/static/img/og/private-multisig.png new file mode 100644 index 00000000..1cc541e4 Binary files /dev/null and b/static/img/og/private-multisig.png differ diff --git a/static/img/og/protocol-accounts.png b/static/img/og/protocol-accounts.png new file mode 100644 index 00000000..f340f8c5 Binary files /dev/null and b/static/img/og/protocol-accounts.png differ diff --git a/static/img/og/protocol.png b/static/img/og/protocol.png new file mode 100644 index 00000000..56a3e2ab Binary files /dev/null and b/static/img/og/protocol.png differ diff --git a/static/img/og/react-sdk.png b/static/img/og/react-sdk.png new file mode 100644 index 00000000..8e3e1f86 Binary files /dev/null and b/static/img/og/react-sdk.png differ diff --git a/static/img/og/reference.png b/static/img/og/reference.png new file mode 100644 index 00000000..8d215fa0 Binary files /dev/null and b/static/img/og/reference.png differ diff --git a/static/img/og/rust-client-cli.png b/static/img/og/rust-client-cli.png new file mode 100644 index 00000000..db7de0cc Binary files /dev/null and b/static/img/og/rust-client-cli.png differ diff --git a/static/img/og/rust-client-get-started.png b/static/img/og/rust-client-get-started.png new file mode 100644 index 00000000..8c4fb35c Binary files /dev/null and b/static/img/og/rust-client-get-started.png differ diff --git a/static/img/og/rust-client.png b/static/img/og/rust-client.png new file mode 100644 index 00000000..702f0081 Binary files /dev/null and b/static/img/og/rust-client.png differ diff --git a/static/img/og/rust-recipes.png b/static/img/og/rust-recipes.png new file mode 100644 index 00000000..22374b4c Binary files /dev/null and b/static/img/og/rust-recipes.png differ diff --git a/static/img/og/smart-contract-accounts.png b/static/img/og/smart-contract-accounts.png new file mode 100644 index 00000000..a69782c6 Binary files /dev/null and b/static/img/og/smart-contract-accounts.png differ diff --git a/static/img/og/smart-contract-notes.png b/static/img/og/smart-contract-notes.png new file mode 100644 index 00000000..1afb13f4 Binary files /dev/null and b/static/img/og/smart-contract-notes.png differ diff --git a/static/img/og/smart-contract-transactions.png b/static/img/og/smart-contract-transactions.png new file mode 100644 index 00000000..7c6f952f Binary files /dev/null and b/static/img/og/smart-contract-transactions.png differ diff --git a/static/img/og/smart-contracts.png b/static/img/og/smart-contracts.png new file mode 100644 index 00000000..f97507da Binary files /dev/null and b/static/img/og/smart-contracts.png differ diff --git a/static/img/og/tools.png b/static/img/og/tools.png new file mode 100644 index 00000000..539a1302 Binary files /dev/null and b/static/img/og/tools.png differ diff --git a/static/img/og/tutorials.png b/static/img/og/tutorials.png new file mode 100644 index 00000000..6b7848ba Binary files /dev/null and b/static/img/og/tutorials.png differ diff --git a/static/img/og/typescript-client.png b/static/img/og/typescript-client.png new file mode 100644 index 00000000..97492c35 Binary files /dev/null and b/static/img/og/typescript-client.png differ diff --git a/static/img/og/typescript-recipes.png b/static/img/og/typescript-recipes.png new file mode 100644 index 00000000..e77bf0f1 Binary files /dev/null and b/static/img/og/typescript-recipes.png differ diff --git a/static/img/og/vm-design.png b/static/img/og/vm-design.png new file mode 100644 index 00000000..48582948 Binary files /dev/null and b/static/img/og/vm-design.png differ diff --git a/static/img/og/vm-stack.png b/static/img/og/vm-stack.png new file mode 100644 index 00000000..76fe65e5 Binary files /dev/null and b/static/img/og/vm-stack.png differ diff --git a/static/img/og/vm-user-docs.png b/static/img/og/vm-user-docs.png new file mode 100644 index 00000000..106e43ea Binary files /dev/null and b/static/img/og/vm-user-docs.png differ