add page title and custom title handling

This commit is contained in:
axolotle 2023-09-07 18:13:09 +02:00
parent 0a7c128ab1
commit 12239ce9ff
4 changed files with 25 additions and 2 deletions

View file

@ -3,6 +3,15 @@ const head = useLocaleHead({
addDirAttribute: true, addDirAttribute: true,
addSeoAttributes: true, addSeoAttributes: true,
}) })
const settings = await useSettings()
useHead({
titleTemplate: (titleChunk) => {
const baseTitle = settings.value.portal_title
return titleChunk ? `${titleChunk} - ${baseTitle}` : baseTitle
},
})
</script> </script>
<template> <template>

View file

@ -6,6 +6,11 @@ import { pick, exclude } from '@/utils/common'
import type { User } from '@/composables/states' import type { User } from '@/composables/states'
const { t } = useI18n() const { t } = useI18n()
useHead({
title: t('footerlink_edit'),
})
const user = await useUser() const user = await useUser()
const loading: Ref<boolean | null> = ref(false) const loading: Ref<boolean | null> = ref(false)

View file

@ -1,9 +1,13 @@
<script setup lang="ts"> <script setup lang="ts">
definePageMeta({
public: true,
})
const { t } = useI18n() const { t } = useI18n()
const appsData = await useApps() const appsData = await useApps()
definePageMeta({ useHead({
public: true, title: t('portal'),
}) })
const apps = computed(() => { const apps = computed(() => {

View file

@ -9,6 +9,11 @@ definePageMeta({
}) })
const { t } = useI18n() const { t } = useI18n()
useHead({
title: t('login'),
})
const isLoggedIn = useIsLoggedIn() const isLoggedIn = useIsLoggedIn()
const { handleSubmit, setErrors } = useForm({ const { handleSubmit, setErrors } = useForm({