2022-11-28 18:01:14 +09:00
|
|
|
import { APP_NAME } from '~/constants'
|
|
|
|
|
|
|
|
const isDev = process.dev
|
|
|
|
const isPreview = window.location.hostname.includes('deploy-preview')
|
|
|
|
|
|
|
|
export function usePageHeader() {
|
2022-11-30 06:13:43 +09:00
|
|
|
const i18n = useI18n()
|
2022-11-28 18:01:14 +09:00
|
|
|
useHead({
|
2022-11-30 06:13:43 +09:00
|
|
|
htmlAttrs: {
|
|
|
|
lang: () => i18n.locale.value,
|
|
|
|
},
|
2022-11-28 18:01:14 +09:00
|
|
|
titleTemplate: title => `${title ? `${title} | ` : ''}${APP_NAME}${isDev ? ' (dev)' : isPreview ? ' (preview)' : ''}`,
|
2022-11-29 22:38:01 +09:00
|
|
|
bodyAttrs: {
|
|
|
|
class: 'overflow-x-hidden',
|
|
|
|
},
|
2022-11-28 18:01:14 +09:00
|
|
|
link: [
|
|
|
|
{ rel: 'icon', type: 'image/svg+png', href: isDev || isPreview ? '/favicon-dev.png' : '/favicon.png' },
|
|
|
|
],
|
|
|
|
})
|
|
|
|
|
|
|
|
// eslint-disable-next-line no-unused-expressions
|
|
|
|
isDark.value
|
|
|
|
}
|