Site settings
settings is the first argument to baseline(). It carries site identity: title, tagline, canonical URL, indexability, languages, and any extra <head> items you want injected on every page.
Settings flow through state.settings and surface in templates as _pageContext.site (and as settings in the data cascade when you keep them in _data/settings.js).
The settings shape
export default {
title: 'Your site',
tagline: 'A short site-wide line.',
url: 'https://www.example.com',
noindex: false,
defaultLanguage: 'en',
languages: { en: {}, fr: {} },
head: {
link: [],
script: [],
meta: [],
style: []
},
seo: {
preserveQueryParams: false,
ogImage: null,
openGraph: {},
twitter: {}
}
};
await eleventyConfig.addPlugin(baseline(settings));
Every key is optional. Baseline logs a warning if settings.url is missing: canonicals are then omitted, and other absolute URLs (sitemap entries, social images) fall back to relative paths.
Keys
-
title (
string)- site title. Used by the head module to compose
<title>(Page title – Site title) and by the navigator template.
- site title. Used by the head module to compose
-
tagline (
string)- short site-wide line. Used as the home page's title suffix and as the default
<meta name="description">when a page has no description of its own.
- short site-wide line. Used as the home page's title suffix and as the default
-
url (
string)- absolute site URL, including protocol. Used to resolve canonical URLs, sitemap entries, and absolute image URLs in the image shortcode. Baseline warns at startup if this is missing.
-
noindex (
boolean, defaultfalse)- when
true, every page renders<meta name="robots" content="noindex, nofollow">and the sitemap is not emitted. Useful for staging environments. Pages can also opt out individually vianoindex: truein front matter.
- when
-
defaultLocale (
string)- BCP 47 default locale (e.g.
'en-US'). Preferred. Sets the site's default language and the fallbackpage.localefor pages whose language has nolocaleof its own. Either this ordefaultLanguageis required for multilingual activation.
- BCP 47 default locale (e.g.
-
defaultLanguage (
string)- Short language code (e.g.
'en'). A writer-side alias fordefaultLocale: set it when you do not need a region, and Baseline derives the locale from it. The default-language permalinks are unprefixed; other languages live under/<lang>/.
- Short language code (e.g.
-
languages (
object | string[])- language map. Object form
{ en: {}, fr: {} }or array shorthand['en', 'fr'](arrays are normalised to objects with empty entries; invalid entries are dropped, logged whenverbose: true). Required for multilingual activation. Per-language overrides are supported fortitle,tagline, andlocale(the BCP 47 tag, e.g.'en-US', that becomespage.localefor pages in that language):
export default { languages: { en: { title: 'Your site', tagline: 'A short line.', locale: 'en-US' }, fr: { title: 'Votre site', tagline: 'Une ligne courte.', locale: 'fr-FR' } } }; - language map. Object form
-
head (
object)- additive
<head>extras injected on every page. Four arrays, one per element type. Each entry is an object whose keys become attributes on the rendered tag.
export default { head: { link: [ { rel: 'stylesheet', href: '/assets/css/index.css' }, { rel: 'icon', href: '/favicon.svg' } ], script: [{ src: '/assets/js/index.js', defer: true }], meta: [{ name: 'theme-color', content: '#0a0a0a' }], style: [] } };Pages can add their own entries through the same shape in front matter; Baseline merges and deduplicates. See the head module for the merge rules.
This is also where you wire the asset pipeline into your pages. Baseline compiles
assets/css/index.cssandassets/js/index.jsto/assets/css/index.cssand/assets/js/index.jsat the site root, but it does not auto-inject them. Declare alinkand ascriptentry as above. The default docs site does exactly this.Output filenames are unhashed today. Cache-busting via hashed filenames is on the roadmap, and the entrypoint declaration shape may change to accommodate it.
In practice
link,script, andmetacarry almost everything you need.styleis supported for parity but rarely used; inline<style>blocks usually belong in your CSS pipeline rather than the head extras list. - additive
-
seo (
object)- site-wide SEO defaults. They feed the resolved
seonamespace and the SEO payload the head module emits (canonical, Open Graph, Twitter Card, JSON-LD). All optional.
export default { seo: { // keep the query string on canonical URLs (default: strip it) preserveQueryParams: false, // default share card; the url must be absolute (it lands in the JSON-LD graph) ogImage: { url: 'https://www.example.com/og.jpg', width: 1200, height: 630, alt: '' }, // default Open Graph and Twitter values, overridable per page openGraph: {}, twitter: {} } };The share image default lives here, in
settings.seo, because it is page presentation: the same shelf asog:typeandtwitter:card. Identity images, an organisation logo or a person's photo, live in theschemacascade key instead, because they are properties of the entity. All three end up as graphImageObjectnodes, so the split is about where the value is authored, not what it becomes. - site-wide SEO defaults. They feed the resolved
SEO front matter
Beyond settings.seo, a page carries its own SEO through front-matter keys. Baseline reads them into the resolved SEO values and the JSON-LD graph the head module emits. Each is optional; a page with none still gets a complete, valid graph from the site defaults.
| Key | Type | What it does |
|---|---|---|
ogImage |
string or object |
Per-page share card. Overrides settings.seo.ogImage. Object form { url, width, height, alt } lets the graph emit a sized ImageObject; a bare string emits a url-only og:image. |
canonical |
string |
Explicit canonical URL. Without it the canonical is the page's own absolute URL. |
preserveQueryParams |
boolean |
Keep the query string on this page's canonical. Overrides the site default. The fragment is always stripped. |
pageType |
string |
Overrides the WebPage node's schema.org @type (e.g. AboutPage, CollectionPage). |
articleType |
string |
Overrides the Article node's @type (e.g. BlogPosting). Takes effect only when the page is an article (type: article). |
topics |
string or string[] |
Keyword classification. Emitted as schema.org keywords on the WebPage and Article nodes, and as og:article:tag on article pages. Separate from Eleventy's native tags, which Baseline leaves alone. Bring your own taxonomy: if you want topic-listing pages, build a collection from topics yourself. |
datePublished |
string |
Publish date for the structured data. Defaults to the page's date. Sets datePublished on the WebPage and Article nodes. |
dateModified |
string |
Last-modified date for the structured data. Resolves front matter first, then the git last-commit date, then the publish date. Sets dateModified. |
Identity authoring, your organisation and author profile plus any extra schema.org nodes, lives in the schema cascade key rather than per-page front matter.
Multilingual activation
Three things must be set together: options.multilingual: true, settings.defaultLocale or settings.defaultLanguage, and a non-empty settings.languages. Nothing is inferred. If any of the three is missing, the multilang module skips activation and logs why.
See the multilang module for what activation enables (per-language collections, hreflang, i18n filters).
Where settings surface
| Surface | Reads |
|---|---|
_pageContext.site |
title, tagline, url, noindex (per-language title/tagline if present) |
_pageContext.meta |
composed <title>, default description from tagline, robots from noindex |
| Head module | head.{link, script, meta, style} extras |
seo namespace |
seo defaults: canonical policy, share image, Open Graph and Twitter values |
| Sitemap module | noindex (skip when true); defaultLanguage and languages for per-lang sitemaps |
| Multilang module | defaultLanguage, languages |
| Image shortcode | url for absolute image URLs |
See also
- Plugin entrypoint - the
optionsargument and what Baseline registers. - Page context - how settings are normalised per page.
- Head module - head extras merge rules.
- Multilang module - activation and per-language behaviour.