diff --git a/astro.config.mjs b/astro.config.mjs index c6c323bf..a79380a5 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -16,13 +16,15 @@ import react from "@astrojs/react"; import starlightLlmsTxt from "starlight-llms-txt"; import favicons from "astro-favicons"; import icon from "astro-icon"; +import lunaria from "@lunariajs/starlight"; import { sidebar } from "./astro.sidebar.ts"; import { ENV } from "./src/lib/env"; import { ogImagesIntegration } from "./src/integrations/ogImages"; -import { SUPPORTED_LANGUAGES, SITE_TITLES } from "./src/config/18n"; +import { SUPPORTED_LANGUAGES, SITE_TITLES } from "./src/config/i18n.mjs"; import { firebaseIntegration } from "./src/integrations/firebase"; import { remarkClientOnly } from "./src/plugins"; import { devServerFileWatcher } from "./src/integrations/dev-server-file-watcher"; +import { filterBoolean } from "./src/utils/filterBoolean"; // import { isMoveReferenceEnabled } from "./src/utils/isMoveReferenceEnabled"; // import { rehypeAddDebug } from "./src/plugins"; @@ -111,12 +113,18 @@ export default defineConfig({ PageTitle: "./src/starlight-overrides/PageTitle.astro", Sidebar: "./src/starlight-overrides/Sidebar.astro", }, - plugins: [ + plugins: filterBoolean([ starlightLlmsTxt({ promote: ["index*", "get-started"], demote: ["404"], exclude: ["404"], }), + // Skip lunaria plugin on CI, since it tries to clone the repo in all workflows + !process.env.GITHUB_RUN_ID && + lunaria({ + sync: true, + route: "/i18n-status", + }), ...(hasAlgoliaConfig ? [ starlightDocSearch({ @@ -142,7 +150,7 @@ export default defineConfig({ ), ] : []), - ], + ]), sidebar, customCss: ["./src/globals.css", "katex/dist/katex.min.css"], }), diff --git a/lunaria.config.json b/lunaria.config.json new file mode 100644 index 00000000..ae93c9f5 --- /dev/null +++ b/lunaria.config.json @@ -0,0 +1,27 @@ +{ + "$schema": "./node_modules/@lunariajs/core/config.schema.json", + "repository": { + "name": "aptos-labs/aptos-docs" + }, + "files": [ + { + "location": "src/content/docs/**/*.{md,mdx}", + "pattern": "src/content/docs/@lang/@path", + "type": "universal" + } + ], + "locales": [ + { + "label": "简体中文", + "lang": "zh" + }, + { + "label": "日本語", + "lang": "ja" + } + ], + "defaultLocale": { + "label": "English", + "lang": "en" + } +} diff --git a/package.json b/package.json index 923e8e09..de684747 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,9 @@ "format:eslint": "pnpm run lint --fix", "format:prettier": "prettier . --write", "format:content": "remark \"src/content/**/*.mdx\" --output --use remark-mdx", - "postinstall": "pnpm exec simple-git-hooks" + "postinstall": "pnpm exec simple-git-hooks", + "lunaria:build": "lunaria build", + "lunaria:preview": "lunaria preview" }, "engines": { "node": "22.x", @@ -45,6 +47,8 @@ "@expressive-code/plugin-collapsible-sections": "^0.40.2", "@graphiql/toolkit": "^0.11.1", "@iconify/json": "^2.2.324", + "@lunariajs/core": "^0.1.1", + "@lunariajs/starlight": "^0.1.1", "@nanostores/react": "^0.8.4", "@octokit/graphql": "^8.2.1", "@readme/openapi-parser": "^2.7.0", @@ -126,7 +130,8 @@ "starlight-openapi": "patches/starlight-openapi.patch", "@scalar/api-client": "patches/@scalar__api-client.patch", "starlight-llms-txt@0.5.0": "patches/starlight-llms-txt@0.5.0.patch", - "@vercel/node": "patches/@vercel__node.patch" + "@vercel/node": "patches/@vercel__node.patch", + "@lunariajs/core@0.1.1": "patches/@lunariajs+core@0.1.1.patch" }, "overrides": { "vite": "^6", diff --git a/patches/@lunariajs+core@0.1.1.patch b/patches/@lunariajs+core@0.1.1.patch new file mode 100644 index 00000000..ab2f6e95 --- /dev/null +++ b/patches/@lunariajs+core@0.1.1.patch @@ -0,0 +1,26 @@ +diff --git a/dist/status/git.mjs b/dist/status/git.mjs +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/dist/status/git.mjs ++++ b/dist/status/git.mjs +@@ -22,7 +22,20 @@ async function handleShallowRepo({ cloneDir, repository }) { + const target = resolve(cloneDir); + if (existsSync(target)) + rmSync(target, { recursive: true, force: true }); +- await git.clone(gitHostingLinks.clone(), target, ["--bare", "--filter=blob:none"]); ++ // Try to use authentication token if available ++ const token = process.env.GITHUB_TOKEN_LUNARIA; ++ const originalCloneUrl = gitHostingLinks.clone(); ++ const cloneUrl = token && repository.hosting === "github" ++ ? `https://${token}@github.com/${repository.name}.git` ++ : originalCloneUrl; ++ ++ try { ++ await git.clone(cloneUrl, target, ["--bare", "--filter=blob:none"]); ++ } catch (e) { ++ // If authentication fails, fall back to the original URL ++ console.log(info("Authentication failed, falling back to public URL")); ++ await git.clone(originalCloneUrl, target, ["--bare", "--filter=blob:none"]); ++ } + await git.cwd({ path: target, root: true }); + } + return isShallowRepo; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a15c35e3..1b79b15f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ overrides: path-to-regexp: '>=6.3.0' patchedDependencies: + '@lunariajs/core@0.1.1': + hash: 2ab0a9a2bda32432baf38b52f232747e526a6bb79cba39ad3d0b4ae1a2087101 + path: patches/@lunariajs+core@0.1.1.patch '@scalar/api-client': hash: 96939a141d97725b3312ccc5c26bf077382d0f8928271b401ce70713c681e67a path: patches/@scalar__api-client.patch @@ -67,6 +70,12 @@ importers: '@iconify/json': specifier: ^2.2.324 version: 2.2.324 + '@lunariajs/core': + specifier: ^0.1.1 + version: 0.1.1(patch_hash=2ab0a9a2bda32432baf38b52f232747e526a6bb79cba39ad3d0b4ae1a2087101) + '@lunariajs/starlight': + specifier: ^0.1.1 + version: 0.1.1(@astrojs/starlight@0.32.6(astro@5.6.1(@types/node@22.14.0)(jiti@2.4.2)(lightningcss@1.29.2)(rollup@4.39.0)(tsx@4.19.3)(typescript@5.8.3)(yaml@2.7.1)))(astro@5.6.1(@types/node@22.14.0)(jiti@2.4.2)(lightningcss@1.29.2)(rollup@4.39.0)(tsx@4.19.3)(typescript@5.8.3)(yaml@2.7.1)) '@nanostores/react': specifier: ^0.8.4 version: 0.8.4(nanostores@0.11.4)(react@19.1.0) @@ -604,6 +613,9 @@ packages: resolution: {integrity: sha512-H45s8fVLYjbhFH62dIJ3WtmJ6RSPt/3DRO0ZcT2SUiYiQyz3BLVb9ADEnLl91m74aQPS3AzzeajZHYOalWe3bg==} engines: {node: '>=6.9.0'} + '@clack/core@0.3.5': + resolution: {integrity: sha512-5cfhQNH+1VQ2xLQlmzXMqUoiaH0lRBq9/CLW9lTyMbuKLC3+xEK01tHVvyut++mLOn5urSHmkm6I0Lg9MaJSTQ==} + '@codemirror/autocomplete@6.18.6': resolution: {integrity: sha512-PHHBXFomUs5DF+9tCOM/UoW6XQ4R44lLNNhRaW9PKPTU0D7lIjRg3ElxaJnTwsl/oHiR93WSXDBrekhoUGCPtg==} @@ -1422,6 +1434,12 @@ packages: '@jsdevtools/ono@7.1.3': resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==} + '@kwsites/file-exists@1.1.1': + resolution: {integrity: sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==} + + '@kwsites/promise-deferred@1.1.1': + resolution: {integrity: sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==} + '@lezer/common@1.2.3': resolution: {integrity: sha512-w7ojc8ejBqr2REPsWxJjrMFsA/ysDCFICn8zEOR9mrqzOu2amhITYuLD8ag6XZf0CFXDrhKqw7+tW8cX66NaDA==} @@ -1449,6 +1467,18 @@ packages: '@lezer/yaml@1.0.3': resolution: {integrity: sha512-GuBLekbw9jDBDhGur82nuwkxKQ+a3W5H0GfaAthDXcAu+XdpS43VlnxA9E9hllkpSP5ellRDKjLLj7Lu9Wr6xA==} + '@lunariajs/core@0.1.1': + resolution: {integrity: sha512-sAqM9+DVsLe3xHM9wu2pEnKGYMs/bWS9qpR+CGHol3RihOELnOQTzHddXbdB1MtgesbI8dnQuG64Ocd8KkWsng==} + engines: {node: '>=18.17.0'} + hasBin: true + + '@lunariajs/starlight@0.1.1': + resolution: {integrity: sha512-tpkqv8TCGUvz0z5nVk1ACb/2bT3seqDx+CHimNQugcpAFSip9BqDPOiWqaCujzZFajfR/L4mUsPAnavnnE8KVw==} + engines: {node: '>=18.17.0'} + peerDependencies: + '@astrojs/starlight': '>=0.14.0' + astro: '>=4.0.0' + '@mapbox/node-pre-gyp@2.0.0': resolution: {integrity: sha512-llMXd39jtP0HpQLVI37Bf1m2ADlEb35GYSh1SDSLsBhR+5iCxiNGlT31yqbNtVHygHAtMy6dWFERpU2JgufhPg==} engines: {node: '>=18'} @@ -4047,6 +4077,10 @@ packages: resolution: {integrity: sha512-PKsK2FSrQCyxcGHsGrLDcK0lx+0Ke+6e8KFFozA9/fIQLhQzPaRvJFdcz7+Axg3jUH/Mq+NI4xa5u/UT2tQskA==} engines: {node: '>=14.16'} + get-port@7.1.0: + resolution: {integrity: sha512-QB9NKEeDg3xxVwCCwJQ9+xycaz6pBB6iQ76wiWMl1927n0Kir6alPiP+yuiICLLU4jpMe08dXfpebuQppFA2zw==} + engines: {node: '>=16'} + get-proto@1.0.1: resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} engines: {node: '>= 0.4'} @@ -4531,6 +4565,10 @@ packages: jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + jiti@1.21.7: + resolution: {integrity: sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==} + hasBin: true + jiti@2.4.2: resolution: {integrity: sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==} hasBin: true @@ -5884,6 +5922,9 @@ packages: resolution: {integrity: sha512-NB3V4XyCOrWTIhjh85DyEoVlM3adHWwqQXKYHmuegy/108bJPP6YxuPGm4ZKBq1+GVKRbKJuzNY//09cMJYp+A==} hasBin: true + simple-git@3.27.0: + resolution: {integrity: sha512-ivHoFS9Yi9GY49ogc6/YAi3Fl9ROnF4VyubNylgCkA+RVqLaKWnDSzXOVzya8csELIaWaYNutsEuAhZrtOjozA==} + simple-swizzle@0.2.2: resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==} @@ -6249,6 +6290,9 @@ packages: ultrahtml@1.6.0: resolution: {integrity: sha512-R9fBn90VTJrqqLDwyMph+HGne8eqY1iPfYhPzZrvKpIfwkWZbcYlfpsb8B9dTvBfpy1/hqAD7Wi8EKfP9e8zdw==} + ultramatter@0.0.4: + resolution: {integrity: sha512-1f/hO3mR+/Hgue4eInOF/Qm/wzDqwhYha4DxM0hre9YIUyso3fE2XtrAU6B4njLqTC8CM49EZaYgsVSa+dXHGw==} + unbox-primitive@1.1.0: resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==} engines: {node: '>= 0.4'} @@ -7363,6 +7407,11 @@ snapshots: '@babel/helper-string-parser': 7.25.9 '@babel/helper-validator-identifier': 7.25.9 + '@clack/core@0.3.5': + dependencies: + picocolors: 1.1.1 + sisteransi: 1.0.5 + '@codemirror/autocomplete@6.18.6': dependencies: '@codemirror/language': 6.11.0 @@ -8330,6 +8379,14 @@ snapshots: '@jsdevtools/ono@7.1.3': {} + '@kwsites/file-exists@1.1.1': + dependencies: + debug: 4.4.0 + transitivePeerDependencies: + - supports-color + + '@kwsites/promise-deferred@1.1.1': {} + '@lezer/common@1.2.3': {} '@lezer/css@1.1.11': @@ -8376,6 +8433,29 @@ snapshots: '@lezer/highlight': 1.2.1 '@lezer/lr': 1.4.2 + '@lunariajs/core@0.1.1(patch_hash=2ab0a9a2bda32432baf38b52f232747e526a6bb79cba39ad3d0b4ae1a2087101)': + dependencies: + '@clack/core': 0.3.5 + fast-glob: 3.3.3 + get-port: 7.1.0 + jiti: 1.21.7 + micromatch: 4.0.8 + path-to-regexp: 6.3.0 + picocolors: 1.1.1 + simple-git: 3.27.0 + ultramatter: 0.0.4 + zod: 3.24.2 + transitivePeerDependencies: + - supports-color + + '@lunariajs/starlight@0.1.1(@astrojs/starlight@0.32.6(astro@5.6.1(@types/node@22.14.0)(jiti@2.4.2)(lightningcss@1.29.2)(rollup@4.39.0)(tsx@4.19.3)(typescript@5.8.3)(yaml@2.7.1)))(astro@5.6.1(@types/node@22.14.0)(jiti@2.4.2)(lightningcss@1.29.2)(rollup@4.39.0)(tsx@4.19.3)(typescript@5.8.3)(yaml@2.7.1))': + dependencies: + '@astrojs/starlight': 0.32.6(astro@5.6.1(@types/node@22.14.0)(jiti@2.4.2)(lightningcss@1.29.2)(rollup@4.39.0)(tsx@4.19.3)(typescript@5.8.3)(yaml@2.7.1)) + '@lunariajs/core': 0.1.1(patch_hash=2ab0a9a2bda32432baf38b52f232747e526a6bb79cba39ad3d0b4ae1a2087101) + astro: 5.6.1(@types/node@22.14.0)(jiti@2.4.2)(lightningcss@1.29.2)(rollup@4.39.0)(tsx@4.19.3)(typescript@5.8.3)(yaml@2.7.1) + transitivePeerDependencies: + - supports-color + '@mapbox/node-pre-gyp@2.0.0': dependencies: consola: 3.4.2 @@ -11527,6 +11607,8 @@ snapshots: get-own-enumerable-keys@1.0.0: {} + get-port@7.1.0: {} + get-proto@1.0.1: dependencies: dunder-proto: 1.0.1 @@ -12156,6 +12238,8 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 + jiti@1.21.7: {} + jiti@2.4.2: {} jose@6.0.10: {} @@ -14006,6 +14090,14 @@ snapshots: simple-git-hooks@2.12.1: {} + simple-git@3.27.0: + dependencies: + '@kwsites/file-exists': 1.1.1 + '@kwsites/promise-deferred': 1.1.1 + debug: 4.4.0 + transitivePeerDependencies: + - supports-color + simple-swizzle@0.2.2: dependencies: is-arrayish: 0.3.2 @@ -14421,6 +14513,8 @@ snapshots: ultrahtml@1.6.0: {} + ultramatter@0.0.4: {} + unbox-primitive@1.1.0: dependencies: call-bound: 1.0.4 diff --git a/scripts/generate-middleware-matcher.js b/scripts/generate-middleware-matcher.js index abd1fdd7..e6a88cdf 100644 --- a/scripts/generate-middleware-matcher.js +++ b/scripts/generate-middleware-matcher.js @@ -22,7 +22,7 @@ const rootDir = path.resolve(__dirname, ".."); async function getSupportedLanguages() { try { // Dynamically import the languages from config file - const { SUPPORTED_LANGUAGES } = await import("../src/config/18n.ts"); + const { SUPPORTED_LANGUAGES } = await import("../src/config/i18n.mjs"); return SUPPORTED_LANGUAGES; } catch (error) { console.error( diff --git a/src/components/Breadcrumbs.astro b/src/components/Breadcrumbs.astro index db1e37b8..b5c35b8e 100644 --- a/src/components/Breadcrumbs.astro +++ b/src/components/Breadcrumbs.astro @@ -2,7 +2,7 @@ import { getPathMaps } from "../loaders/breadcrumbsLoader"; // Extract locale from the URL path -import { SUPPORTED_LANGUAGES } from "~/config/18n"; +import { SUPPORTED_LANGUAGES } from "~/config/i18n.mjs"; // --- Component Props --- interface Props { diff --git a/src/components/Move404/index.astro b/src/components/Move404/index.astro index 0d8f0c00..a53e5dbe 100644 --- a/src/components/Move404/index.astro +++ b/src/components/Move404/index.astro @@ -1,7 +1,7 @@ --- import { Code } from "@astrojs/starlight/components"; import defaultCode from "./code/404.move?raw"; -import { SUPPORTED_LANGUAGES } from "~/config/18n"; +import { SUPPORTED_LANGUAGES } from "~/config/i18n.mjs"; // Create a type from the supported language codes (excluding 'en' which uses default) type SupportedLang = Exclude<(typeof SUPPORTED_LANGUAGES)[number]["code"], "en">; diff --git a/src/config/18n.ts b/src/config/i18n.mjs similarity index 100% rename from src/config/18n.ts rename to src/config/i18n.mjs diff --git a/src/loaders/breadcrumbsLoader.ts b/src/loaders/breadcrumbsLoader.ts index 4a787888..43aaf90b 100644 --- a/src/loaders/breadcrumbsLoader.ts +++ b/src/loaders/breadcrumbsLoader.ts @@ -1,5 +1,5 @@ import { getCollection } from "astro:content"; -import { SUPPORTED_LANGUAGES } from "~/config/18n"; +import { SUPPORTED_LANGUAGES } from "~/config/i18n.mjs"; // Define the return type for the path maps export interface PathMaps { diff --git a/src/middlewares/i18n-redirect.ts b/src/middlewares/i18n-redirect.ts index ab64346a..aa97da4c 100644 --- a/src/middlewares/i18n-redirect.ts +++ b/src/middlewares/i18n-redirect.ts @@ -1,4 +1,4 @@ -import { SUPPORTED_LANGUAGES } from "../config/18n"; +import { SUPPORTED_LANGUAGES } from "../config/i18n.mjs"; const LANGUAGE_CODES = SUPPORTED_LANGUAGES.map((lang) => lang.code); const DEFAULT_LANG = "en"; diff --git a/src/pages/[...lang]/move-reference.astro b/src/pages/[...lang]/move-reference.astro index 2d32836f..0bfac03f 100644 --- a/src/pages/[...lang]/move-reference.astro +++ b/src/pages/[...lang]/move-reference.astro @@ -3,7 +3,7 @@ import { getCollection } from "astro:content"; import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"; import { Tabs, TabItem } from "@astrojs/starlight/components"; import FallbackContentNotice from "@astrojs/starlight/components/FallbackContentNotice.astro"; -import { SUPPORTED_LANGUAGES } from "~/config/18n"; +import { SUPPORTED_LANGUAGES } from "~/config/i18n.mjs"; import { MOVE_REFERENCE_BRANCHES, type MoveNetwork } from "~/content.config"; import { isMoveReferenceEnabled } from "~/utils/isMoveReferenceEnabled"; import MoveReferenceDisabled from "~/components/MoveReferenceDisabled.astro"; diff --git a/src/pages/[...lang]/move-reference/[...slug].astro b/src/pages/[...lang]/move-reference/[...slug].astro index e464dd41..205f50ff 100644 --- a/src/pages/[...lang]/move-reference/[...slug].astro +++ b/src/pages/[...lang]/move-reference/[...slug].astro @@ -2,7 +2,7 @@ import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"; import FallbackContentNotice from "@astrojs/starlight/components/FallbackContentNotice.astro"; import { getCollection, render } from "astro:content"; -import { SUPPORTED_LANGUAGES } from "~/config/18n"; +import { SUPPORTED_LANGUAGES } from "~/config/i18n.mjs"; import { isMoveReferenceEnabled } from "~/utils/isMoveReferenceEnabled"; export async function getStaticPaths() { diff --git a/src/pages/[...lang]/move-reference/[network]/[framework].astro b/src/pages/[...lang]/move-reference/[network]/[framework].astro index 45d0b76c..b12f87a6 100644 --- a/src/pages/[...lang]/move-reference/[network]/[framework].astro +++ b/src/pages/[...lang]/move-reference/[network]/[framework].astro @@ -2,7 +2,7 @@ import { getCollection } from "astro:content"; import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"; import FallbackContentNotice from "@astrojs/starlight/components/FallbackContentNotice.astro"; -import { SUPPORTED_LANGUAGES } from "~/config/18n"; +import { SUPPORTED_LANGUAGES } from "~/config/i18n.mjs"; import LinkList from "~/components/LinkList.astro"; import { isMoveReferenceEnabled } from "~/utils/isMoveReferenceEnabled"; diff --git a/src/pages/[...lang]/move-reference/[network]/index.astro b/src/pages/[...lang]/move-reference/[network]/index.astro index d38ca06f..60ded0e0 100644 --- a/src/pages/[...lang]/move-reference/[network]/index.astro +++ b/src/pages/[...lang]/move-reference/[network]/index.astro @@ -3,7 +3,7 @@ import { getCollection } from "astro:content"; import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"; import { CardGrid, LinkCard } from "@astrojs/starlight/components"; import FallbackContentNotice from "@astrojs/starlight/components/FallbackContentNotice.astro"; -import { SUPPORTED_LANGUAGES } from "~/config/18n"; +import { SUPPORTED_LANGUAGES } from "~/config/i18n.mjs"; import { isMoveReferenceEnabled } from "~/utils/isMoveReferenceEnabled"; import { MOVE_REFERENCE_BRANCHES } from "~/content.config"; diff --git a/src/starlight-overrides/Head.astro b/src/starlight-overrides/Head.astro index cfb9b54c..3b9fb2ea 100644 --- a/src/starlight-overrides/Head.astro +++ b/src/starlight-overrides/Head.astro @@ -3,7 +3,7 @@ import Default from "@astrojs/starlight/components/Head.astro"; // import { ClientRouter } from "astro:transitions"; import { Schema } from "astro-seo-schema"; import TextSizeProvider from "../components/TextSizeProvider.astro"; -import { SUPPORTED_LANGUAGES } from "~/config/18n"; +import { SUPPORTED_LANGUAGES } from "~/config/i18n.mjs"; import { getImageUrl } from "~/lib/og-image/getImageUrl"; const entryData = Astro.locals.starlightRoute.entry.data || Astro.props.entry.data; diff --git a/src/starlight-overrides/PageTitle.astro b/src/starlight-overrides/PageTitle.astro index 1f8c3c3b..dc557708 100644 --- a/src/starlight-overrides/PageTitle.astro +++ b/src/starlight-overrides/PageTitle.astro @@ -1,6 +1,5 @@ --- import Default from "@astrojs/starlight/components/PageTitle.astro"; -import type { Props } from "@astrojs/starlight/props"; import Breadcrumbs from "~/components/Breadcrumbs.astro"; // Get the current URL path diff --git a/src/utils/filterBoolean.ts b/src/utils/filterBoolean.ts new file mode 100644 index 00000000..78f622e7 --- /dev/null +++ b/src/utils/filterBoolean.ts @@ -0,0 +1,2 @@ +export const filterBoolean = (arr: T[]) => + arr.filter(Boolean) as Exclude[];