mirror of https://github.com/elk-zone/elk.git
24 lines
654 B
TypeScript
24 lines
654 B
TypeScript
import { APP_NAME } from '~/constants'
|
|
|
|
const isDev = process.dev
|
|
const isPreview = window.location.hostname.includes('deploy-preview')
|
|
|
|
export function usePageHeader() {
|
|
const i18n = useI18n()
|
|
useHead({
|
|
htmlAttrs: {
|
|
lang: () => i18n.locale.value,
|
|
},
|
|
titleTemplate: title => `${title ? `${title} | ` : ''}${APP_NAME}${isDev ? ' (dev)' : isPreview ? ' (preview)' : ''}`,
|
|
bodyAttrs: {
|
|
class: 'overflow-x-hidden',
|
|
},
|
|
link: [
|
|
{ rel: 'icon', type: 'image/svg+png', href: isDev || isPreview ? '/favicon-dev.png' : '/favicon.png' },
|
|
],
|
|
})
|
|
|
|
// eslint-disable-next-line no-unused-expressions
|
|
isDark.value
|
|
}
|