<script setup>
const { data: appSiteSettings } = await useFetch('/api/site-settings', {
  key: 'site-settings-public',
  default: () => ({
    title: 'sori.studio',
    faviconUrl: '',
    logoUrl: '',
    logoText: '井'
  })
})

useHead(() => ({
  titleTemplate: (titleChunk) => titleChunk
    ? `${titleChunk} · ${appSiteSettings.value.title}`
    : appSiteSettings.value.title,
  link: appSiteSettings.value.faviconUrl
    ? [
      {
        rel: 'icon',
        type: 'image/png',
        href: appSiteSettings.value.faviconUrl
      }
    ]
    : []
}))
</script>

<template>
  <NuxtLayout>
    <NuxtPage />
  </NuxtLayout>
</template>
