Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

discoverLayouts

función Since 1.5.0

Descubre los layouts con nombre de app/layouts de un proyecto, layer o módulo: cada app/layouts/<nombre>.meeko, también en subcarpetas (app/layouts/admin/panel.meeko es "admin/panel"). Los enlaces simbólicos no cuentan, como app/layouts/default.meeko hasta 1.4, y un archivo cuya ruta no es un nombre válido (_partes.meeko, mi layout.meeko) tampoco.

ts
import { discoverLayouts } from "@meekojs/meeko/build";

Source code src/framework/routes-discovery.ts:472

Firma #

ts
function discoverLayouts(sourceRoot: string): Promise<Readonly<Record<string, string>>>

Parameters #

sourceRoot string

Carpeta que contiene app/layouts.

Returns #

Promise<Readonly<Record<string, string>>>

El archivo absoluto de cada layout, por nombre.

Example #

ts
import { discoverLayouts } from "@meekojs/meeko/build";

const layouts = await discoverLayouts(process.cwd());
console.log(Object.keys(layouts)); // ["admin/panel", "dashboard", "default"]

See also #

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: packages/meeko/src/framework/routes-discovery.ts