-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathapp.vue
70 lines (60 loc) · 1.59 KB
/
app.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<template>
<div>
<Page>
<NuxtLoadingIndicator :color="color" :height="4" />
<NuxtPage />
</Page>
</div>
</template>
<script lang="ts" setup>
import tailwindConfig from '@/tailwind.config'
import { joinURL } from 'ufo'
const runtimeConfig = useRuntimeConfig()
const color = (tailwindConfig.theme?.extend?.colors as any)?.['accent']?.['700']
const { data, error } = await useAsyncData(() => useGraphqlQuery('AllSettings'))
const allSettings = computed(() => data.value?.data.allSettings)
const viewer = computed(() => data.value?.data.viewer)
if (!allSettings.value || error.value) {
throw createError({ statusCode: 500, message: 'Error fetching settings' })
}
const siteName = allSettings.value.generalSettingsTitle || ''
const siteDescription = allSettings.value.generalSettingsDescription || undefined
useHead({
templateParams: {
siteName: siteName,
},
})
useSeoMeta({
title: 'Home',
description: siteDescription,
ogImage: () => joinURL(runtimeConfig.public.siteUrl, '/images/og.jpg'),
})
useSchemaOrg([
definePerson({
name: () => `${viewer.value?.firstName} ${viewer.value?.lastName}`,
logo: () => viewer.value?.avatar?.url || undefined,
sameAs: () => viewer.value?.url || undefined,
}),
defineWebSite({
name: siteName,
}),
defineWebPage(),
])
</script>
<style lang="postcss">
.page-enter-active,
.page-leave-active {
transition: all 150ms;
}
.page-enter-from,
.page-leave-to {
opacity: 0;
filter: blur(0.25rem);
}
.page-enter-from {
transform: translate(0, 0.5rem);
}
.page-leave-to {
transform: translate(0, -0.5rem);
}
</style>