-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: ✏️ add built-in-plugins\router-render_es.md (#1030)
- Loading branch information
1 parent
8f1d186
commit 3004185
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
docs/Reference/plugins/built-in-plugins/router-render_es.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
title: Complemento router-render | ||
published: true | ||
lang: es | ||
position: 100 | ||
--- | ||
|
||
# Complemento `router-render` | ||
|
||
## Visión General | ||
|
||
Por defecto, Scully usar puppeteer para renderizar las páginas del enrutador. | ||
Con este tipo de complemento, puedes personalizar el renderizado de una URL. | ||
|
||
Para user `router-render` necesitas agregar en la configuración de tu aplicación, las rutas y enviar la información. | ||
|
||
`scully.{{your_app}}.config.ts` | ||
|
||
```typescript | ||
proxyConfig: 'proxy.conf.js', | ||
// maxRenderThreads: 4, | ||
routes: { | ||
// here i need a routePlugin with renderPlugin | ||
'/url/some_url': { | ||
type: 'pluginHandler', | ||
options: { | ||
folder: '/example/folder', | ||
}, | ||
}, | ||
``` | ||
También debes registrar el complemento, el sistema de complementos utiliza registerPlugin para eso (para más información visita la documentación sobre [registrar un nuevo complemento](/docs/Reference/plugins/custom-plugins/register-a-new-plugin)) | ||
`scully.{{your_app}}.config.ts` | ||
```typescript | ||
registerPlugin('router', 'pluginHandler', (url, options) => { | ||
// read the folder and all the files routes. | ||
return [{ route: '/example/folder/file-1', renderPlugin: 'PageOptimizer' }]; | ||
}); | ||
``` | ||
En este caso, Scully tratará renderizar esa URL con el complemento `PageOptimizer`, si existe algún problema enla ejecución del complemento, Scully reintentará con puppeteer. |