Meridian handbook
Content modellingFields

SEO

The seo field: a per-locale search title and description and their social-sharing pair, with length warnings, the stored shape, and how head() uses it.

An seo field holds the copy a search results page and a shared link show for a document: a title, a description, and optionally a different title and description for social sharing. It is translated per locale. Declare it under any name that is not reserved (seo itself is reserved): meta is conventional.

fields:
  - name: meta
    type: seo
    title_max: 60
    description_max: 155
    label: { en-GB: Search and sharing }

Parameters

ParameterTypeDefaultWhat it does
title_maxwhole number60The title length a warning starts at.
description_maxwhole number160The description length a warning starts at.

A results page truncates rather than refuses, so these are warnings, never errors:

CodePathWhen
max_length<name>.titleThe title is longer than title_max.
max_length<name>.descriptionThe description is longer than description_max.
seo_description_short<name>.descriptionThe description is under 50 characters.

The editor shows a title input and a description box, with the social pair behind a disclosure that starts open when either is written.

Stored value and template value

{ "title": "Hook Norton Brewery tours", "description": "A Victorian tower brewery...", "og_title": "", "og_description": "" }

A template receives title, description, og_title and og_description. You rarely print them yourself: head() writes the page’s title, meta description and Open Graph and Twitter tags from the type’s first seo field, each social value falling back to the search one on its own (SEO and structured data).

<head>
  {{ head() }}
</head>

A document’s own seo title and description replace the generated ones only where they are written; an empty one leaves the generated copy, which is the document’s title and its summary. On an engine-dmo landing page, the content document’s seo field gives the social pair. An seo field is not projected into the query index.