@dargmuesli/nuxt-vio 1.8.0 → 1.8.2

Sign up to get free protection for your applications and to get access to all the features.
package/app.config.ts ADDED
@@ -0,0 +1,19 @@
1
+ import { useSeoMeta } from '@unhead/vue'
2
+
3
+ import { SITE_NAME } from './utils/constants'
4
+
5
+ export default defineAppConfig({
6
+ seoMeta: {
7
+ twitterSite: '@dargmuesli',
8
+ },
9
+ siteName: SITE_NAME,
10
+ themeColor: '#202020',
11
+ })
12
+
13
+ declare module '@nuxt/schema' {
14
+ interface AppConfigInput {
15
+ seoMeta?: Parameters<typeof useSeoMeta>[0]
16
+ siteName: string
17
+ themeColor?: string
18
+ }
19
+ }
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <div :data-is-loading="isLoading">
3
+ <NuxtLayout>
4
+ <SeoKit :site-description="siteDescription" :language="locale" />
5
+ <OgImageStatic :alt="ogImageAlt" component="OgImage" />
6
+ <NuxtPage />
7
+ <CookieControl :locale="locale" />
8
+ </NuxtLayout>
9
+ </div>
10
+ </template>
11
+
12
+ <script setup lang="ts">
13
+ export interface Props {
14
+ siteDescription: string
15
+ ogImageAlt: string
16
+ }
17
+ withDefaults(defineProps<Props>(), {})
18
+
19
+ const { locale } = useI18n()
20
+ const cookieControl = useCookieControl()
21
+
22
+ const { loadingIds, indicateLoadingDone } = useLoadingDoneIndicator('app')
23
+
24
+ // computations
25
+ const isLoading = computed(() => !!loadingIds.value.length)
26
+
27
+ // lifecycle
28
+ onMounted(() => indicateLoadingDone())
29
+ watch(
30
+ () => cookieControl.cookiesEnabledIds.value,
31
+ (current, previous) => {
32
+ if (
33
+ (!previous?.includes('ga') && current?.includes('ga')) ||
34
+ (previous?.includes('ga') && !current?.includes('ga'))
35
+ ) {
36
+ window.location.reload()
37
+ }
38
+ },
39
+ { deep: true }
40
+ )
41
+ // initialization
42
+ useAppLayout()
43
+ useFavicons()
44
+ </script>
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <div class="p-4 md:px-8">
3
+ <main>
4
+ <slot />
5
+ </main>
6
+ </div>
7
+ </template>
@@ -1,7 +1,5 @@
1
1
  <template>
2
- <div class="p-4 md:px-8">
3
- <main>
4
- <slot />
5
- </main>
6
- </div>
2
+ <VioLayout>
3
+ <slot />
4
+ </VioLayout>
7
5
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-vio",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -18,6 +18,7 @@
18
18
  "pages",
19
19
  "plugins",
20
20
  "utils",
21
+ "app.config.ts",
21
22
  "error.vue",
22
23
  "nuxt.config.ts",
23
24
  "tailwind.config.ts"