dkitdkit
dkit:module

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.

All relations
  • 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
Access
  • dkit Settings Public Read
    Public 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 = {}
    ): SiteMetadata
  • async 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): boolean
  • Feature 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 | null
  • function siteLogoUrl(settings: SiteSettings | null | undefined): string | null
  • function siteOgImageUrl(settings: SiteSettings | null | undefined): string | null
  • Normalized social links from settings (skips incomplete rows).

    function siteSocialLinks(settings: SiteSettings | null | undefined): SiteSocialLink[]
  • function socialLinkLabel(link: SiteSocialLink): string
  • function socialLinkProps(link: SiteSocialLink):

Flows & seed

Optional Directus extras from services/. Flows apply on dkit add; seed only with --seed.

Seed
services/seed.json — import with npx @kurbo/dkit add settings --seed

Files

  • 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
site-logo
Renders the settings logo image only — optional link wrap
Loading preview…

site-logo

Next · shadcn · dkit

npx @kurbo/dkit add site-brand
site-brand
Logo, site name, and tagline from settings — compose into header/footer layouts
Loading preview…

site-brand

Next · shadcn · dkit

npx @kurbo/dkit add social-links
social-links
Renders settings social_links (platform dropdown) as a link row
Loading preview…

social-links

Next · shadcn · dkit

npx @kurbo/dkit add maintenance-gate
maintenance-gate
Wraps the app — shows a maintenance screen when settings.maintenance_mode is on
Loading preview…

maintenance-gate

Next · shadcn · dkit