Add dynamic title

This commit is contained in:
2025-08-01 01:31:11 +02:00
parent 28b42762fe
commit 03527b2fe0
3 changed files with 19 additions and 3 deletions
@@ -1,6 +1,14 @@
<script setup lang="ts">
const app = useNuxtApp();
const { huntSlug, questSlug } = app.$slugData;
const { t } = useI18n();
useHead({
title: t('layouts.title', {
title:
[questSlug?.name, huntSlug?.name].join(' | ') || t('layouts.default_tile')
})
});
</script>
<template>
+7
View File
@@ -2,12 +2,19 @@
const app = useNuxtApp();
const { user } = useUserSession();
const localePath = useLocalePath();
const { t } = useI18n();
const { name, id } = app.$slugData.huntSlug!;
const { data, pending } = await useFetch(`/api/hunt/${id}`);
const hideAnswers = ref(true);
useHead({
title: t('layouts.title', {
title: data.value?.name || name
})
});
</script>
<template>