Skip to content

Commit

Permalink
docs: ✏️ add built-in-plugins\router-render_es.md (#1030)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexScigalszky committed Oct 5, 2020
1 parent 8f1d186 commit 3004185
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions docs/Reference/plugins/built-in-plugins/router-render_es.md
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.

0 comments on commit 3004185

Please sign in to comment.