Settings
Site brand and config singleton — name, logo, contact, socials, feature flags
npx @kurbo/dkit add settings
Interactive install multi-selects UI components (defaults pre-selected). Schema only: npx @kurbo/dkit add settings --schema-only · With sample data: npx @kurbo/dkit add settings --seed
Schema
Collections and fields from this module's snapshot.json (dkit.rest). Names below are logical; dkit add applies your collection prefix.
- site_settings.logo → directus_files · on_delete SET NULL
- site_settings.favicon → directus_files · on_delete SET NULL
- site_settings.og_image → directus_files · on_delete SET NULL
- dkit Settings Public ReadPublic read for site settings singleton and logo/favicon files. UI owns presentation.
- read → site_settings [*]
- read → directus_files [*]
Services
Fetch and write helpers installed as lib/dkit/settings.ts. Import from @/lib/dkit/settings. See Services.
Build Next-compatible metadata from a settings row.
function buildSiteMetadata( settings: SiteSettings | null | undefined, options: BuildSiteMetadataOptions = {} ): SiteMetadataasync function generateMetadata()Typed field accessor — returns undefined when settings are unavailable.
async function getSetting()Read the site settings singleton.
async function getSettings(_options: GetSettingsOptions = {}): Promise<SiteSettings | null>Fetch settings and build site metadata in one call.
async function getSiteMetadata(options: BuildSiteMetadataOptions = {}): Promise<SiteMetadata>function isExternalSocialHref(href: string): booleanFeature flag lookup — missing flags are false.
async function isFeatureEnabled(flag: string): Promise<boolean>True when settings.maintenance_mode is enabled. Soft-fails to false.
async function isMaintenanceMode(): Promise<boolean>function siteFaviconUrl(settings: SiteSettings | null | undefined): string | nullfunction siteLogoUrl(settings: SiteSettings | null | undefined): string | nullfunction siteOgImageUrl(settings: SiteSettings | null | undefined): string | nullNormalized social links from settings (skips incomplete rows).
function siteSocialLinks(settings: SiteSettings | null | undefined): SiteSocialLink[]function socialLinkLabel(link: SiteSocialLink): stringfunction socialLinkProps(link: SiteSocialLink):
Flows & seed
Optional Directus extras from services/. Flows apply on dkit add; seed only with --seed.
services/seed.json — import with npx @kurbo/dkit add settings --seedFiles
- dkit logo · dkit-logo.svg · image/svg+xml
site_settings1 item
- aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaa0001
UI preview
Preview data comes from the module seed — the same JSON as dkit add --seed.
npx @kurbo/dkit add site-logo
npx @kurbo/dkit add site-brand
npx @kurbo/dkit add social-links
npx @kurbo/dkit add maintenance-gate