@xenterprises/nuxt-x-marketing 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.playground/app.config.ts +4 -0
- package/.playground/pages/index.vue +1 -5
- package/app.config.ts +27 -0
- package/components/X/Footer/index.vue +8 -0
- package/nuxt.config.ts +7 -1
- package/package.json +2 -1
- package/pages/blog/[...slug].vue +83 -0
- package/pages/blog/index.vue +59 -6
package/app.config.ts
CHANGED
|
@@ -7,8 +7,12 @@ export default defineAppConfig({
|
|
|
7
7
|
},
|
|
8
8
|
xMarketing: {
|
|
9
9
|
name: "X Enterprises",
|
|
10
|
+
url: "https://x-enterprises.com",
|
|
10
11
|
config: {
|
|
11
12
|
markerProjectId: "",
|
|
13
|
+
emailMarketingNewsletters: {
|
|
14
|
+
organizationId: "",
|
|
15
|
+
},
|
|
12
16
|
},
|
|
13
17
|
header: {
|
|
14
18
|
logo: {
|
|
@@ -37,6 +41,17 @@ export default defineAppConfig({
|
|
|
37
41
|
socials: [],
|
|
38
42
|
columns: [],
|
|
39
43
|
},
|
|
44
|
+
blog: {
|
|
45
|
+
active: true,
|
|
46
|
+
title: "Blog",
|
|
47
|
+
description:
|
|
48
|
+
"Welcome to our blog. Here you can find the latest news, updates, and articles.",
|
|
49
|
+
meta: {
|
|
50
|
+
title: "Blog",
|
|
51
|
+
description:
|
|
52
|
+
"Welcome to our blog. Here you can find the latest news, updates, and articles.",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
40
55
|
},
|
|
41
56
|
});
|
|
42
57
|
|
|
@@ -47,6 +62,9 @@ declare module "@nuxt/schema" {
|
|
|
47
62
|
name?: string;
|
|
48
63
|
config?: {
|
|
49
64
|
markerProjectId?: string;
|
|
65
|
+
emailMarketingNewsletters?: {
|
|
66
|
+
organizationId?: string;
|
|
67
|
+
};
|
|
50
68
|
};
|
|
51
69
|
header?: {
|
|
52
70
|
logo?: {
|
|
@@ -98,6 +116,15 @@ declare module "@nuxt/schema" {
|
|
|
98
116
|
}[];
|
|
99
117
|
}[];
|
|
100
118
|
};
|
|
119
|
+
blog?: {
|
|
120
|
+
active?: boolean;
|
|
121
|
+
title?: string;
|
|
122
|
+
description?: string;
|
|
123
|
+
meta?: {
|
|
124
|
+
title?: string;
|
|
125
|
+
description?: string;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
101
128
|
};
|
|
102
129
|
}
|
|
103
130
|
}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
+
<XMarketingSectionsEmailSubscription
|
|
4
|
+
:organizationId="
|
|
5
|
+
appConfig?.xMarketing?.config?.emailMarketingNewsletters?.organizationId
|
|
6
|
+
"
|
|
7
|
+
v-if="
|
|
8
|
+
appConfig?.xMarketing?.config?.emailMarketingNewsletters?.organizationId
|
|
9
|
+
"
|
|
10
|
+
/>
|
|
3
11
|
<section
|
|
4
12
|
class="relative pt-24 overflow-hidden"
|
|
5
13
|
:class="footer?.bg?.color ? footer?.bg?.color : 'bg-gray-900'"
|
package/nuxt.config.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
2
2
|
export default defineNuxtConfig({
|
|
3
3
|
compatibilityDate: "2024-04-03",
|
|
4
|
+
ssr: true,
|
|
4
5
|
devtools: { enabled: process.env.NODE_ENV === "development" },
|
|
6
|
+
runtimeConfig: {
|
|
7
|
+
public: {
|
|
8
|
+
BUILDERIO_KEY: "",
|
|
9
|
+
},
|
|
10
|
+
},
|
|
5
11
|
extends: ["@nuxt/ui-pro"],
|
|
6
|
-
modules: ["@nuxt/ui", "@nuxtjs/seo"],
|
|
12
|
+
modules: ["@nuxt/ui", "@nuxtjs/seo", "@nuxt/image"],
|
|
7
13
|
ui: {
|
|
8
14
|
icons: ["heroicons", "simple-icons"],
|
|
9
15
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xenterprises/nuxt-x-marketing",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.16",
|
|
5
5
|
"main": "./nuxt.config.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "nuxi dev .playground",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@marker.io/browser": "^0.19.0",
|
|
20
|
+
"@nuxt/image": "^1.8.1",
|
|
20
21
|
"@nuxt/ui": "^2.18.7",
|
|
21
22
|
"@nuxt/ui-pro": "^1.4.4",
|
|
22
23
|
"@nuxtjs/seo": "^2.0.0-rc.23",
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<main class="bg-white">
|
|
4
|
+
<header
|
|
5
|
+
class="w-full h-[460px] xl:h-[537px] bg-no-repeat bg-cover bg-center bg-blend-darken relative"
|
|
6
|
+
:style="`background-image: url('${content.headerImage}?format=webp')`"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="absolute top-0 left-0 w-full h-full bg-black bg-opacity-50"
|
|
10
|
+
></div>
|
|
11
|
+
<div
|
|
12
|
+
class="absolute top-20 left-1/2 px-4 mx-auto w-full max-w-screen-xl -translate-x-1/2 xl:top-1/2 xl:-translate-y-1/2 xl:px-0"
|
|
13
|
+
>
|
|
14
|
+
<h1
|
|
15
|
+
class="mb-4 max-w-6xl text-4xl font-extrabold leading-none text-white sm:text-5xl lg:text-7xl px-4"
|
|
16
|
+
>
|
|
17
|
+
{{ content.title }}
|
|
18
|
+
</h1>
|
|
19
|
+
</div>
|
|
20
|
+
</header>
|
|
21
|
+
<div
|
|
22
|
+
class="flex flex-col relative z-20 justify-between p-8 -mt-36 mx-4 max-w-screen-xl bg-white rounded-xl xl:-mt-32 xl:p-9 xl:mx-auto pb-24 shadow-sm"
|
|
23
|
+
>
|
|
24
|
+
<div class="absolute right-0 top-0 p-3">
|
|
25
|
+
<UButton to="/blog" label="Back to Blog List" variant="ghost" />
|
|
26
|
+
</div>
|
|
27
|
+
<div>
|
|
28
|
+
<div class="text-4xl text-black font-bold pb-6">
|
|
29
|
+
{{ content.title }}
|
|
30
|
+
</div>
|
|
31
|
+
<article
|
|
32
|
+
class="xl:w-[828px] w-full max-w-none format format-sm sm:format-base lg:format-lg format-blue pb-24"
|
|
33
|
+
>
|
|
34
|
+
<div
|
|
35
|
+
class="flex flex-col lg:flex-row justify-between lg:items-center"
|
|
36
|
+
>
|
|
37
|
+
<div
|
|
38
|
+
class="flex items-center space-x-3 text-gray-500 text-base mb-2 lg:mb-0"
|
|
39
|
+
>
|
|
40
|
+
<section
|
|
41
|
+
class="prose md:prose-xl lg:prose-xl prose-stone"
|
|
42
|
+
v-html="content.body"
|
|
43
|
+
></section>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</article>
|
|
47
|
+
|
|
48
|
+
<aside class="hidden xl:block" aria-labelledby="sidebar-label">
|
|
49
|
+
<div class="xl:w-[336px] sticky top-6">
|
|
50
|
+
<h3 id="sidebar-label" class="sr-only">Sidebar</h3>
|
|
51
|
+
</div>
|
|
52
|
+
</aside>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</main>
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<script setup>
|
|
60
|
+
const route = useRoute();
|
|
61
|
+
const config = useRuntimeConfig();
|
|
62
|
+
const builder = await $fetch(`https://cdn.builder.io/api/v2/content/posts/`, {
|
|
63
|
+
query: {
|
|
64
|
+
apiKey: config?.public?.BUILDERIO_KEY,
|
|
65
|
+
limit: 1,
|
|
66
|
+
"query.data.slug": route.params.slug[0],
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
const content = computed(() => {
|
|
70
|
+
return builder.results[0].data;
|
|
71
|
+
});
|
|
72
|
+
const title = builder.results[0].data.title;
|
|
73
|
+
const description = builder.results[0].data.description;
|
|
74
|
+
useSeoMeta({
|
|
75
|
+
title,
|
|
76
|
+
ogTitle: title,
|
|
77
|
+
description,
|
|
78
|
+
ogDescription: description,
|
|
79
|
+
});
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style lang="scss" scoped>
|
|
83
|
+
</style>
|
package/pages/blog/index.vue
CHANGED
|
@@ -1,10 +1,63 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="max-w-screen-2xl
|
|
3
|
-
<UPageHero
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<div class="pb-8 max-w-screen-2xl px-8 mx-auto">
|
|
3
|
+
<UPageHero :title="blog?.title" :description="blog?.description" />
|
|
4
|
+
|
|
5
|
+
<UPageBody>
|
|
6
|
+
<UBlogList>
|
|
7
|
+
<UBlogPost
|
|
8
|
+
v-for="(post, index) in blogPosts?.results"
|
|
9
|
+
:key="index"
|
|
10
|
+
:to="`/blog/${post?.data?.slug}`"
|
|
11
|
+
:title="post?.name"
|
|
12
|
+
:description="post?.data?.summary"
|
|
13
|
+
:image="{ src: post?.data?.thumbnail, alt: post?.name }"
|
|
14
|
+
:orientation="index === 0 ? 'horizontal' : 'vertical'"
|
|
15
|
+
:class="[index === 0 && 'col-span-full']"
|
|
16
|
+
:ui="{
|
|
17
|
+
description: 'line-clamp-3',
|
|
18
|
+
}"
|
|
19
|
+
>
|
|
20
|
+
<div class="mt-4">
|
|
21
|
+
<UButton
|
|
22
|
+
:to="`/blog/${post?.data?.slug}`"
|
|
23
|
+
variant="outline"
|
|
24
|
+
label="Read More"
|
|
25
|
+
/>
|
|
26
|
+
</div>
|
|
27
|
+
</UBlogPost>
|
|
28
|
+
</UBlogList>
|
|
29
|
+
</UPageBody>
|
|
7
30
|
</div>
|
|
8
31
|
</template>
|
|
32
|
+
|
|
9
33
|
<script setup>
|
|
10
|
-
|
|
34
|
+
const appConfig = useAppConfig()?.xMarketing;
|
|
35
|
+
const blog = appConfig?.blog;
|
|
36
|
+
const route = useRoute();
|
|
37
|
+
const config = useRuntimeConfig();
|
|
38
|
+
|
|
39
|
+
const blogPosts = await $fetch("https://cdn.builder.io/api/v2/content/posts", {
|
|
40
|
+
query: {
|
|
41
|
+
apiKey: config?.public?.BUILDERIO_KEY,
|
|
42
|
+
offset: 0,
|
|
43
|
+
fields: "id,name,data.slug,data.summary,data.thumbnail",
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
const title = blog?.meta?.title;
|
|
47
|
+
const description = blog?.meta?.description;
|
|
48
|
+
useSeoMeta({
|
|
49
|
+
title,
|
|
50
|
+
ogTitle: title,
|
|
51
|
+
description,
|
|
52
|
+
ogDescription: description,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// useHead({
|
|
56
|
+
// link: [
|
|
57
|
+
// {
|
|
58
|
+
// rel: "canonical",
|
|
59
|
+
// href: appConfig?.url + "/blog",
|
|
60
|
+
// },
|
|
61
|
+
// ],
|
|
62
|
+
// });
|
|
63
|
+
</script>
|