1
0

app.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <script setup lang="ts">
  2. const { seo } = useAppConfig()
  3. const colorMode = useColorMode()
  4. const isDark = computed({
  5. get() {
  6. return colorMode.value === 'dark'
  7. },
  8. set(_isDark) {
  9. colorMode.preference = _isDark ? 'dark' : 'light'
  10. },
  11. })
  12. const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('docs'))
  13. const { data: files } = useLazyAsyncData('search', () => queryCollectionSearchSections('docs'), {
  14. server: false,
  15. })
  16. useHead({
  17. meta: [
  18. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  19. ],
  20. link: [
  21. { rel: 'icon', href: isDark.value ? '/favicon-dark.svg' : '/favicon.svg' },
  22. ],
  23. htmlAttrs: {
  24. lang: 'en',
  25. },
  26. })
  27. useSeoMeta({
  28. titleTemplate: title => title ? `${title} · TresJS` : 'TresJS: Building 3D scenes with Vue',
  29. ogSiteName: seo?.siteName,
  30. twitterCard: 'summary_large_image',
  31. ogImage: '/og-image.png',
  32. twitterImage: '/og-image.png',
  33. ogUrl: 'https://tresjs.org',
  34. twitterTitle: 'TresJS: Building 3D scenes with Vue',
  35. twitterDescription: 'TresJS is a library for building 3D scenes with Vue. It provides a set of components and utilities for creating and managing 3D scenes.',
  36. })
  37. provide(navigationInjectionKey, navigation)
  38. </script>
  39. <template>
  40. <UApp>
  41. <NuxtLoadingIndicator />
  42. <AppHeader />
  43. <UMain class="pattern-bg">
  44. <NuxtLayout>
  45. <NuxtPage />
  46. </NuxtLayout>
  47. </UMain>
  48. <AppFooter />
  49. <ClientOnly>
  50. <LazyUContentSearch
  51. :files="files"
  52. :navigation="navigation"
  53. />
  54. </ClientOnly>
  55. </UApp>
  56. </template>