Site Settings
Site settings hold values that apply across the site. Templates can use them for site identity, pagination, date handling, social profiles, and search metadata.
Configure settings
Section titled “Configure settings”Open Settings in the EmDash admin, then choose the page for the values you need:
- General contains the site status (staging or live), site title, tagline, logo, favicon, public URL, posts per page, date format, and timezone. See Hide a site until it goes live. Change the public URL with Change domain; see Move to a New Domain.
- Social contains profile handles for the supported social services.
- SEO contains the title separator, default social image, verification values,
robots.txtcontent, and the AI training opt-out. See Built-in SEO Features for what each one does.
-
Open the relevant settings page.
-
Enter the values used by the site’s templates and metadata.
-
Save the page, then reload a public page that renders those settings.
Settings are optional until configured. A template should provide a suitable fallback for any value it requires.
Read settings in a layout
Section titled “Read settings in a layout”Use getSiteSettings() when a layout needs several values. It returns the configured keys as a partial object and resolves media references before returning them.
The following base layout uses site identity settings and lets EmDashHead apply the configured favicon, default social image, and site-wide verification metadata:
---import { getSiteSettings } from "emdash";import { createPublicPageContext } from "emdash/page";import { EmDashHead } from "emdash/ui";
interface Props { title?: string; description?: string;}
const { title, description } = Astro.props;const settings = await getSiteSettings();const siteTitle = settings.title ?? "My site";const fullTitle = title ? `${title} — ${siteTitle}` : siteTitle;const pageDescription = description ?? settings.tagline;
const page = createPublicPageContext({ Astro, kind: "custom", pageType: "website", title: fullTitle, pageTitle: title ?? siteTitle, description: pageDescription, siteName: siteTitle,});---
<!doctype html><html lang={Astro.currentLocale ?? "en"}> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width" /> <title>{fullTitle}</title> <EmDashHead page={page} /> </head> <body> <header> <a href="/" aria-label={siteTitle}> {settings.logo?.url ? ( <img src={settings.logo.url} alt={settings.logo.alt ?? siteTitle} width={settings.logo.width} height={settings.logo.height} /> ) : ( siteTitle )} </a> {settings.tagline && <p>{settings.tagline}</p>} </header>
<main> <slot /> </main> </body></html>