diff --git a/src/content/docs/de/reference/integrations-reference.mdx b/src/content/docs/de/reference/integrations-reference.mdx index 2b403ebe08637..a3f2ea4cacefa 100644 --- a/src/content/docs/de/reference/integrations-reference.mdx +++ b/src/content/docs/de/reference/integrations-reference.mdx @@ -29,7 +29,7 @@ interface AstroIntegration { addRenderer: (renderer: AstroRenderer) => void; addWatchFile: (path: URL | string) => void; injectScript: (stage: InjectedScriptStage, content: string) => void; - injectRoute: ({ pattern: string, entryPoint: string }) => void; + injectRoute: ({ pattern: string, entrypoint: string }) => void; }) => void; 'astro:config:done'?: (options: { config: AstroConfig }) => void | Promise; 'astro:server:setup'?: (options: { server: vite.ViteDevServer }) => void | Promise; @@ -67,7 +67,7 @@ interface AstroIntegration { addRenderer: (renderer: AstroRenderer) => void; addWatchFile: (path: URL | string) => void; injectScript: (stage: InjectedScriptStage, content: string) => void; - injectRoute: ({ pattern: string, entryPoint: string }) => void; + injectRoute: ({ pattern: string, entrypoint: string }) => void; }) => void; ``` @@ -141,21 +141,21 @@ addWatchFile(new URL('./tailwind.config.js', config.root)); #### `injectRoute`-Option -**Typ:** `({ pattern: string, entryPoint: string }) => void;` +**Type:** `({ pattern: string, entrypoint: string }) => void;` Eine Callback-Funktion, um Routen in ein Astro-Projekt zu injizieren. Injizierte Routen können [`.astro`-Seiten](/de/core-concepts/astro-pages/) oder [`.js` und `.ts`-Routenhandler](/de/core-concepts/endpoints/#endpunkte-für-statische-dateien) sein. `injectRoute` nimmt ein Objekt mit einem `Pattern` und einem `EntryPoint`. - `pattern` - wo die Route im Browser ausgegeben werden soll, z.B. `/foo/bar`. Ein Muster kann Astros Dateipfad-Syntax verwenden, um dynamische Routen zu bezeichnen, z.B. `/foo/[bar]` oder `/foo/[...bar]`. Beachte, dass eine Dateierweiterung **nicht** im `Pattern` benötigt wird. -- `entryPoint` - ein reiner Modulbezeichner, der auf die `.astro`-Seite oder den `.js`/`.ts`-Routenhandler zeigt, der die im `pattern` angegebene Route bearbeitet. +- `entrypoint` - ein reiner Modulbezeichner, der auf die `.astro`-Seite oder den `.js`/`.ts`-Routenhandler zeigt, der die im `pattern` angegebene Route bearbeitet. Beispiel für die Verwendung: ```js injectRoute({ pattern: '/foo/[dynamic]', - entryPoint: 'foo/dynamic-page.astro' + entrypoint: 'foo/dynamic-page.astro' }); ``` diff --git a/src/content/docs/en/reference/integrations-reference.mdx b/src/content/docs/en/reference/integrations-reference.mdx index f1f4859bb5ec1..9a56c7fce100d 100644 --- a/src/content/docs/en/reference/integrations-reference.mdx +++ b/src/content/docs/en/reference/integrations-reference.mdx @@ -33,7 +33,7 @@ interface AstroIntegration { addMiddleware: (middleware: AstroIntegrationMiddleware) => void; addDevToolbarApp: (pluginEntrypoint: string) => void; injectScript: (stage: InjectedScriptStage, content: string) => void; - injectRoute: ({ pattern: string, entryPoint: string }) => void; + injectRoute: ({ pattern: string, entrypoint: string }) => void; logger: AstroIntegrationLogger; }) => void; 'astro:config:done'?: (options: { config: AstroConfig; logger: AstroIntegrationLogger; }) => void | Promise; @@ -80,7 +80,7 @@ interface AstroIntegration { addDevToolbarApp: (pluginEntrypoint: string) => void; addWatchFile: (path: URL | string) => void; injectScript: (stage: InjectedScriptStage, content: string) => void; - injectRoute: ({ pattern: string, entryPoint: string }) => void; + injectRoute: ({ pattern: string, entrypoint: string }) => void; logger: AstroIntegrationLogger; }) => void; ``` @@ -309,14 +309,14 @@ export const onRequest = defineMiddleware(async (context, request) => { #### `injectRoute` option -**Type:** `({ pattern: string, entryPoint: string }) => void;` +**Type:** `({ pattern: string, entrypoint: string }) => void;` A callback function to inject routes into an Astro project. Injected routes can be [`.astro` pages](/en/core-concepts/astro-pages/) or [`.js` and `.ts` route handlers](/en/core-concepts/endpoints/#static-file-endpoints). -`injectRoute` takes an object with a `pattern` and an `entryPoint`. +`injectRoute` takes an object with a `pattern` and an `entrypoint`. - `pattern` - where the route should be output in the browser, for example `/foo/bar`. A `pattern` can use Astro's filepath syntax for denoting dynamic routes, for example `/foo/[bar]` or `/foo/[...bar]`. Note that a file extension is **not** needed in the `pattern`. -- `entryPoint` - a bare module specifier pointing towards the `.astro` page or `.js`/`.ts` route handler that handles the route denoted in the `pattern`. +- `entrypoint` - a bare module specifier pointing towards the `.astro` page or `.js`/`.ts` route handler that handles the route denoted in the `pattern`. ##### Example usage @@ -325,7 +325,7 @@ injectRoute({ // Use Astro’s pattern syntax for dynamic routes. pattern: '/subfolder/[dynamic]', // Use relative path syntax for a local route. - entryPoint: './src/dynamic-page.astro' + entrypoint: './src/dynamic-page.astro' }); ``` @@ -335,7 +335,7 @@ The following example shows a package published to npm as `@fancy/dashboard` inj ```js injectRoute({ pattern: '/fancy-dashboard', - entryPoint: '@fancy/dashboard/dashboard.astro' + entrypoint: '@fancy/dashboard/dashboard.astro' }); ``` diff --git a/src/content/docs/es/reference/integrations-reference.mdx b/src/content/docs/es/reference/integrations-reference.mdx index 147e65c79a207..984c57e2a4ae1 100644 --- a/src/content/docs/es/reference/integrations-reference.mdx +++ b/src/content/docs/es/reference/integrations-reference.mdx @@ -33,7 +33,7 @@ interface AstroIntegration { addMiddleware: (middleware: AstroIntegrationMiddleware) => void; addDevToolbarApp: (pluginEntrypoint: string) => void; injectScript: (stage: InjectedScriptStage, content: string) => void; - injectRoute: ({ pattern: string, entryPoint: string }) => void; + injectRoute: ({ pattern: string, entrypoint: string }) => void; logger: AstroIntegrationLogger; }) => void; 'astro:config:done'?: (options: { config: AstroConfig; logger: AstroIntegrationLogger; }) => void | Promise; @@ -80,7 +80,7 @@ interface AstroIntegration { addDevToolbarApp: (pluginEntrypoint: string) => void; addWatchFile: (path: URL | string) => void; injectScript: (stage: InjectedScriptStage, content: string) => void; - injectRoute: ({ pattern: string, entryPoint: string }) => void; + injectRoute: ({ pattern: string, entrypoint: string }) => void; logger: AstroIntegrationLogger; }) => void; ``` @@ -309,14 +309,14 @@ export const onRequest = defineMiddleware(async (context, request) => { #### Opción `injectRoute` -**Tipo:** `({ pattern: string, entryPoint: string }) => void;` +**Tipo:** `({ pattern: string, entrypoint: string }) => void;` Una función callback para inyectar rutas a un proyecto de Astro. Las rutas inyectadas pueden ser [páginas `.astro`](/es/core-concepts/astro-pages/) o [handlers de ruta `.js` y `.ts`](/es/core-concepts/endpoints/#endpoints-de-archivos-estáticos). -`injectRoute` toma un objeto con un `pattern` y un `entryPoint`. +`injectRoute` toma un objeto con un `pattern` y un `entrypoint`. - `pattern` - es la ruta en el navegador, por ejemplo `/foo/bar`. Un `pattern` puede usar la sintaxis de ruta de archivo de Astro para indicar rutas dinámicas, por ejemplo `/foo/[bar]` o `/foo/[...bar]`. Tenga en cuenta que **no** se necesita una extensión de archivo en el `patrón`. -- `entryPoint` - un especificador de módulo simple que apunta hacia la página `.astro` o el controlador de ruta `.js`/`.ts` que maneja la ruta indicada en el `pattern`. +- `entrypoint` - un especificador de módulo simple que apunta hacia la página `.astro` o el controlador de ruta `.js`/`.ts` que maneja la ruta indicada en el `pattern`. ##### Ejemplo de uso @@ -325,7 +325,7 @@ injectRoute({ // Utiliza la sintaxis de patrón de Astro para rutas dinámicas. pattern: '/subfolder/[dynamic]', // Utiliza la sintaxis de ruta relativa para una ruta local. - entryPoint: './src/dynamic-page.astro' + entrypoint: './src/dynamic-page.astro' }); ``` @@ -335,7 +335,7 @@ El siguiente ejemplo muestra un paquete publicado en npm como `@fancy/dashboard` ```js injectRoute({ pattern: '/fancy-dashboard', - entryPoint: '@fancy/dashboard/dashboard.astro' + entrypoint: '@fancy/dashboard/dashboard.astro' }); ``` diff --git a/src/content/docs/pt-br/reference/integrations-reference.mdx b/src/content/docs/pt-br/reference/integrations-reference.mdx index 390af51e23c5c..69902fca034b6 100644 --- a/src/content/docs/pt-br/reference/integrations-reference.mdx +++ b/src/content/docs/pt-br/reference/integrations-reference.mdx @@ -31,7 +31,7 @@ interface AstroIntegration { addWatchFile: (path: URL | string) => void; addClientDirective: (directive: ClientDirectiveConfig) => void; injectScript: (stage: InjectedScriptStage, content: string) => void; - injectRoute: ({ pattern: string, entryPoint: string }) => void; + injectRoute: ({ pattern: string, entrypoint: string }) => void; logger: AstroIntegrationLogger; }) => void; 'astro:config:done'?: (options: { config: AstroConfig; logger: AstroIntegrationLogger; }) => void | Promise; @@ -76,7 +76,7 @@ interface AstroIntegration { addClientDirective: (directive: ClientDirectiveConfig) => void; addWatchFile: (path: URL | string) => void; injectScript: (stage: InjectedScriptStage, content: string) => void; - injectRoute: ({ pattern: string, entryPoint: string }) => void; + injectRoute: ({ pattern: string, entrypoint: string }) => void; logger: AstroIntegrationLogger; }) => void; ``` @@ -216,14 +216,14 @@ declare module 'astro' { #### Opção `injectRoute` -**Tipo:** `({ pattern: string, entryPoint: string }) => void;` +**Tipo:** `({ pattern: string, entrypoint: string }) => void;` Uma função de callback para injetar rotas em um projeto Astro. Rotas injetadas podem ser [páginas `.astro`](/pt-br/core-concepts/astro-pages/) ou [handlers de rotas `.js` e `.ts`](/pt-br/core-concepts/endpoints/#endpoints-de-arquivos-estáticos). -`injectRoute` recebe um objeto com um `pattern` e um `entryPoint`. +`injectRoute` recebe um objeto com um `pattern` e um `entrypoint`. - `pattern` - aonde a rota deve ser inserida no navegador, por exemplo `/foo/bar`. Um `pattern` pode utilizar a sintaxe de caminho de arquivos do Astro para indicar rotas dinâmicas, por exemplo `/foo/[bar]` ou `/foo/[...bar]`. Note que uma extensão de arquivo **não** é necessária no `pattern`. -- `entryPoint` - apenas um especificador de módulo apontando para a página `.astro` ou handler de rota `.js`/`.ts` que manipula a rota indicada no `pattern`. +- `entrypoint` - apenas um especificador de módulo apontando para a página `.astro` ou handler de rota `.js`/`.ts` que manipula a rota indicada no `pattern`. ##### Exemplo de uso @@ -232,7 +232,7 @@ injectRoute({ // Usa o padrão de sintaxe do Astro para rotas dinâmicas. pattern: '/subpasta/[dinamico]', // Usa a sintaxe de caminho relativo para uma rota local. - entryPoint: './src/pagina-dinamica.astro' + entrypoint: './src/pagina-dinamica.astro' }); ``` @@ -242,7 +242,7 @@ O seguinte exemplo mostra um pacote publicado para o npm como `@chique/painel` i ```js injectRoute({ pattern: '/painel-chique', - entryPoint: '@chique/painel/painel.astro' + entrypoint: '@chique/painel/painel.astro' }); ``` diff --git a/src/content/docs/zh-cn/reference/integrations-reference.mdx b/src/content/docs/zh-cn/reference/integrations-reference.mdx index 59c75d24592fc..c09ef51484f8d 100644 --- a/src/content/docs/zh-cn/reference/integrations-reference.mdx +++ b/src/content/docs/zh-cn/reference/integrations-reference.mdx @@ -33,7 +33,7 @@ interface AstroIntegration { addMiddleware: (middleware: AstroIntegrationMiddleware) => void; addDevToolbarApp: (pluginEntrypoint: string) => void; injectScript: (stage: InjectedScriptStage, content: string) => void; - injectRoute: ({ pattern: string, entryPoint: string }) => void; + injectRoute: ({ pattern: string, entrypoint: string }) => void; }) => void; 'astro:config:done'?: (options: { config: AstroConfig; logger: AstroIntegrationLogger; }) => void | Promise; 'astro:server:setup'?: (options: { server: vite.ViteDevServer; logger: AstroIntegrationLogger; }) => void | Promise; @@ -79,7 +79,7 @@ interface AstroIntegration { addDevToolbarApp: (pluginEntrypoint: string) => void; addWatchFile: (path: URL | string) => void; injectScript: (stage: InjectedScriptStage, content: string) => void; - injectRoute: ({ pattern: string, entryPoint: string }) => void; + injectRoute: ({ pattern: string, entrypoint: string }) => void; logger: AstroIntegrationLogger; }) => void; ``` @@ -308,14 +308,14 @@ export const onRequest = defineMiddleware(async (context, request) => { #### `injectRoute` 选项 -**类型**:`({ pattern: string, entryPoint: string }) => void;` +**类型**:`({ pattern: string, entrypoint: string }) => void;` 用于向 Astro 项目注入路由的回调函数。注入的路由可以是 [`.astro`页面](/zh-cn/core-concepts/astro-pages/) 或 [`.js`和`.ts`路由处理程序](/zh-cn/core-concepts/endpoints/#静态文件端点)。 -`injectRoute` 接收带有 `pattern` 和 `entryPoint` 的对象值。 +`injectRoute` 接收带有 `pattern` 和 `entrypoint` 的对象值。 - `pattern` - 应该在浏览器中使用的路由,例如 `/foo/bar`。`pattern` 可以使用 Astro 的文件路径语法来表示动态路由,例如 `/foo/[bar]` 或 `/foo/[...bar]`。请注意,在 `pattern` 中**无需**文件扩展名。 -- `entryPoint` — 裸模块指定器,指向 `.astro` 页面或 `.js`/`.ts` 路由处理程序,处理`pattern` 中指定路由。 +- `entrypoint` — 裸模块指定器,指向 `.astro` 页面或 `.js`/`.ts` 路由处理程序,处理`pattern` 中指定路由。 ##### 使用示例 @@ -324,7 +324,7 @@ injectRoute({ // 使用 Astro 语法模式来匹配动态路由 pattern: '/subfolder/[dynamic]', // 使用相对路径语法来匹配本地路由 - entryPoint: './src/dynamic-page.astro' + entrypoint: './src/dynamic-page.astro' }); ``` @@ -335,7 +335,7 @@ injectRoute({ ```js injectRoute({ pattern: '/fancy-dashboard', - entryPoint: '@fancy/dashboard/dashboard.astro' + entrypoint: '@fancy/dashboard/dashboard.astro' }); ```