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.

DocumentHead

interfaz Since 1.2.0

head de DocumentConfig y de meeko.addHead en los módulos: lo mismo que HeadInput, pero titleTemplate sólo puede ser una cadena, porque el documento se fija en el build como JSON y llega así al navegador. Su title es el título del sitio: lo muestran, tal cual y sin titleTemplate, las páginas que no tienen título propio o lo dejan vacío.

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

Source code src/shared/head.ts:196

Declaración #

ts
interface DocumentHead extends Omit<HeadInput, 'titleTemplate'> {
	titleTemplate?: string
}

Example #

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

// «Precios - Mi Sitio» en una página titulada «Precios»; «Mi Sitio» en una sin título.
const head: DocumentHead = {
  title: "Mi Sitio",
  titleTemplate: "%s - Mi Sitio",
  htmlAttrs: { lang: "es" },
};

Propiedades #

titleTemplate #

propiedad opcional

titleTemplate?: string

Plantilla del título, con %s en el lugar del título. Se aplica al título de layouts, páginas, useHead y el head de la ruta, no al title del documento. Una función no se admite aquí: no se puede fijar en el build.

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/shared/head.ts