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.

PageHead

interfaz

Metadatos del documento que devuelve el head de una página. Sin title se conserva el del host, o ninguno. Desde 1.2 admite también las etiquetas y los atributos de HeadInput (con titleTemplate sólo como cadena, porque viaja en el payload de navegación); el head de la ruta tiene la máxima prioridad frente a useHead.

ts
import type { PageHead } from "@meekojs/meeko/framework";

Source code src/app/definitions/define-page.ts:141

Declaración #

ts
interface PageHead extends Omit<HeadInput, 'title' | 'titleTemplate'> {
	readonly title?: string
	readonly description?: string
	readonly titleTemplate?: string
}

Example #

ts
import { definePage } from "@meekojs/meeko/framework";
import type { PageHead } from "@meekojs/meeko/framework";

export const route = definePage({
  load: () => ({ name: "Ada", avatar: "https://example.com/ada.png" }),
  head: ({ data }): PageHead => ({
    title: `Perfil de ${data.name}`,
    meta: [{ property: "og:image", content: data.avatar }],
  }),
});

Propiedades #

title #

propiedad sólo lectura opcional

readonly title?: string

Título del documento: <title> en SSR y document.title al navegar.

description #

propiedad sólo lectura opcional since 1.1.0

readonly description?: string

Descripción del documento: <meta name="description"> en SSR y en el prerender, actualizada al navegar. Una página sin descripción conserva la del host, o ninguna.

titleTemplate #

propiedad sólo lectura opcional since 1.2.0

readonly titleTemplate?: string

Plantilla del título, con %s en el lugar del título.

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/app/definitions/define-page.ts