@xenterprises/nuxt-x-marketing 0.0.24 → 1.0.1

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.
Files changed (114) hide show
  1. package/.playground/app.config.ts +44 -45
  2. package/.playground/app.vue +263 -0
  3. package/.playground/components/AppFooter.vue +103 -0
  4. package/.playground/components/AppHeader.vue +41 -0
  5. package/.playground/components/CodeExample.vue +70 -0
  6. package/.playground/components/ComponentPlayground.vue +117 -0
  7. package/.playground/components/DocsHeader.vue +19 -0
  8. package/.playground/layouts/default.vue +13 -3
  9. package/.playground/layouts/docs-layout.vue +161 -0
  10. package/.playground/layouts/docs.vue +11 -0
  11. package/.playground/pages/blog/author.vue +145 -0
  12. package/.playground/pages/blog/card.vue +149 -0
  13. package/.playground/pages/blog/cta.vue +131 -0
  14. package/.playground/pages/blog/detail.vue +471 -0
  15. package/.playground/pages/blog/list.vue +261 -0
  16. package/.playground/pages/blog/navigation.vue +228 -0
  17. package/.playground/pages/blog/sidebar.vue +279 -0
  18. package/.playground/pages/config.vue +289 -0
  19. package/.playground/pages/content/comparison.vue +253 -0
  20. package/.playground/pages/content/cta.vue +245 -0
  21. package/.playground/pages/content/features.vue +217 -0
  22. package/.playground/pages/content/newsletter-section.vue +260 -0
  23. package/.playground/pages/content/newsletter.vue +200 -0
  24. package/.playground/pages/content/pricing.vue +335 -0
  25. package/.playground/pages/content/testimonials.vue +188 -0
  26. package/.playground/pages/hero.vue +257 -0
  27. package/.playground/pages/index.vue +379 -2
  28. package/.playground/pages/layout/footer.vue +210 -0
  29. package/.playground/pages/layout/legal-footer.vue +121 -0
  30. package/.playground/pages/layout/navbar.vue +285 -0
  31. package/.playground/pages/layout/section.vue +266 -0
  32. package/.playground/pages/layout/x-legal.vue +199 -0
  33. package/.playground/pages/modals/feature-modal.vue +320 -0
  34. package/.playground/pages/modals/image-lightbox.vue +277 -0
  35. package/.playground/pages/modals/video-modal.vue +222 -0
  36. package/.playground/pages/notifications/announcement-bar.vue +164 -0
  37. package/.playground/pages/notifications/cookie-banner.vue +210 -0
  38. package/.playground/pages/notifications/cookie-toast.vue +143 -0
  39. package/.playground/pages/notifications/gdpr.vue +276 -0
  40. package/.playground/pages/notifications/social-proof-toast.vue +515 -0
  41. package/.playground/pages/ui/badge.vue +161 -0
  42. package/.playground/pages/ui/bg-pattern.vue +177 -0
  43. package/.playground/pages/ui/glass-card.vue +179 -0
  44. package/.playground/pages/ui/glow-divider.vue +179 -0
  45. package/.playground/pages/ui/promo-card.vue +259 -0
  46. package/.playground/pages/ui/section-stitch.vue +411 -0
  47. package/.playground/pages/utilities/back-to-top.vue +153 -0
  48. package/.playground/pages/utilities/popup-chat.vue +224 -0
  49. package/README.md +799 -164
  50. package/app/app.config.ts +88 -2
  51. package/app/app.vue +106 -11
  52. package/app/assets/css/x-marketing.css +669 -0
  53. package/app/components/X/Footer/XLegal/index.vue +63 -26
  54. package/app/components/X/Footer/index.vue +89 -89
  55. package/app/components/X/Header/App.vue +63 -0
  56. package/app/components/X/Mark/Blog/Author.vue +170 -0
  57. package/app/components/X/Mark/Blog/CTANewsletter.vue +197 -0
  58. package/app/components/X/Mark/Blog/Card.vue +117 -0
  59. package/app/components/X/Mark/Blog/Detail.vue +187 -0
  60. package/app/components/X/Mark/Blog/List.vue +156 -0
  61. package/app/components/X/Mark/Blog/Navigation.vue +100 -0
  62. package/app/components/X/Mark/Blog/Sidebar.vue +160 -0
  63. package/app/components/X/Mark/Button/BackToTop.vue +99 -0
  64. package/app/components/X/Mark/CTA/index.vue +294 -0
  65. package/app/components/X/Mark/Card/Glass.vue +64 -0
  66. package/app/components/X/Mark/Card/Promo.vue +164 -0
  67. package/app/components/X/Mark/CodeBlock/index.vue +69 -0
  68. package/app/components/X/Mark/Divider/Glow.vue +113 -0
  69. package/app/components/X/Mark/Features/index.vue +194 -0
  70. package/app/components/X/Mark/Hero/index.vue +217 -0
  71. package/app/components/X/Mark/Layout/AnnouncementBar.vue +139 -0
  72. package/app/components/X/Mark/Layout/Footer.vue +160 -0
  73. package/app/components/X/Mark/Layout/FooterLegal.vue +42 -0
  74. package/app/components/X/Mark/Layout/Navbar.vue +267 -0
  75. package/app/components/X/Mark/Modal/Chat.vue +151 -0
  76. package/app/components/X/Mark/Modal/Feature.vue +197 -0
  77. package/app/components/X/Mark/Modal/Image.vue +226 -0
  78. package/app/components/X/Mark/Modal/Video.vue +203 -0
  79. package/app/components/X/Mark/Modal/index.vue +133 -0
  80. package/app/components/X/Mark/Newsletter/Form.vue +174 -0
  81. package/app/components/X/Mark/Pattern/Bg.vue +86 -0
  82. package/app/components/X/Mark/Pricing/Comparison.vue +126 -0
  83. package/app/components/X/Mark/Pricing/Plans.vue +181 -0
  84. package/app/components/X/Mark/Privacy/CookieBanner.vue +112 -0
  85. package/app/components/X/Mark/Privacy/CookieToast.vue +43 -0
  86. package/app/components/X/Mark/Privacy/GDPR.vue +245 -0
  87. package/app/components/X/Mark/Section/Newsletter.vue +183 -0
  88. package/app/components/X/Mark/Section/Stitch.vue +156 -0
  89. package/app/components/X/Mark/Section/index.vue +151 -0
  90. package/app/components/X/Mark/SocialProof/Badge.vue +102 -0
  91. package/app/components/X/Mark/SocialProof/Testimonials.vue +326 -0
  92. package/app/components/X/Mark/SocialProof/Toast.vue +181 -0
  93. package/app/components/X/Mark/_archive/Pattern/Background.vue +83 -0
  94. package/app/components/X/Mark/_archive/Pattern/CheckBg.vue +35 -0
  95. package/app/components/X/Mark/_archive/Pattern/CircuitBg.vue +41 -0
  96. package/app/components/X/Mark/_archive/Pattern/DotsBg.vue +35 -0
  97. package/app/components/X/Mark/_archive/Pattern/GlowDivider.vue +86 -0
  98. package/app/components/X/Mark/_archive/Pattern/HexBg.vue +35 -0
  99. package/app/components/X/Mark/_archive/Pattern/PlaidBg.vue +47 -0
  100. package/app/components/X/Mark/_archive/Pattern/SectionStitch.vue +168 -0
  101. package/app/components/X/Mark/_archive/Pattern/WaveBg.vue +41 -0
  102. package/app/components/X/_archive/Newsletter/Form.vue +123 -0
  103. package/app/components/X/_archive/Newsletter/Section.vue +131 -0
  104. package/app/composables/useParallax.ts +124 -0
  105. package/app/composables/useScrollReveal.ts +92 -0
  106. package/app/pages/index.vue +210 -0
  107. package/app/plugins/marketing.client.ts +13 -0
  108. package/app/types/marketing.d.ts +268 -0
  109. package/componentList.json +511 -0
  110. package/nuxt.config.ts +14 -8
  111. package/package.json +24 -10
  112. package/.editorconfig +0 -12
  113. package/app/assets/css/main.css +0 -9
  114. package/app/components/X/Marketing/Sections/EmailSubscription/index.vue +0 -129
@@ -0,0 +1,131 @@
1
+ <template>
2
+ <div class="min-h-screen">
3
+ <div class="bg-white dark:bg-neutral-900 border-b border-neutral-200 dark:border-neutral-800 px-8 py-6">
4
+ <h1 class="text-2xl font-bold text-neutral-900 dark:text-white">Blog Newsletter CTA</h1>
5
+ <p class="mt-2 text-neutral-600 dark:text-neutral-400">In-article call-to-action for newsletter signups.</p>
6
+ </div>
7
+
8
+ <div class="p-8 space-y-16">
9
+ <div class="space-y-12">
10
+ <!-- Default -->
11
+ <section>
12
+ <h3 class="text-lg font-semibold mb-4">Default</h3>
13
+ <div class="max-w-2xl">
14
+ <XMarkBlogCTANewsletter
15
+ title="Enjoying this article?"
16
+ description="Subscribe to get notified when we publish new content."
17
+ :button="{ label: 'Subscribe' }"
18
+ />
19
+ </div>
20
+ </section>
21
+
22
+ <!-- Featured -->
23
+ <section>
24
+ <h3 class="text-lg font-semibold mb-4">Featured</h3>
25
+ <div class="max-w-2xl">
26
+ <XMarkBlogCTANewsletter
27
+ title="Join our newsletter"
28
+ description="Get the latest posts delivered right to your inbox."
29
+ :button="{ label: 'Subscribe Now' }"
30
+ variant="featured"
31
+ />
32
+ </div>
33
+ </section>
34
+
35
+ <!-- Inline -->
36
+ <section>
37
+ <h3 class="text-lg font-semibold mb-4">Inline</h3>
38
+ <div class="max-w-2xl">
39
+ <XMarkBlogCTANewsletter
40
+ title="Stay updated"
41
+ description="New posts every week."
42
+ :button="{ label: 'Join' }"
43
+ variant="inline"
44
+ />
45
+ </div>
46
+ </section>
47
+
48
+ <!-- Compact -->
49
+ <section>
50
+ <h3 class="text-lg font-semibold mb-4">Compact (for sidebars)</h3>
51
+ <div class="max-w-xs">
52
+ <XMarkBlogCTANewsletter
53
+ title="Subscribe"
54
+ description="Get notified about new posts."
55
+ :button="{ label: 'Subscribe' }"
56
+ variant="compact"
57
+ />
58
+ </div>
59
+ </section>
60
+ </div>
61
+
62
+ <!-- Props Documentation -->
63
+ <div class="border-t border-neutral-200 dark:border-neutral-800 pt-16">
64
+ <h2 class="text-lg font-semibold mb-6">Props</h2>
65
+ <div class="overflow-x-auto">
66
+ <table class="w-full text-sm">
67
+ <thead>
68
+ <tr class="border-b border-neutral-200 dark:border-neutral-700">
69
+ <th class="text-left py-3 px-4 font-medium">Prop</th>
70
+ <th class="text-left py-3 px-4 font-medium">Type</th>
71
+ <th class="text-left py-3 px-4 font-medium">Default</th>
72
+ <th class="text-left py-3 px-4 font-medium">Description</th>
73
+ </tr>
74
+ </thead>
75
+ <tbody class="divide-y divide-neutral-200 dark:divide-neutral-700">
76
+ <tr><td class="py-3 px-4 font-mono text-xs">title</td><td class="py-3 px-4">String</td><td class="py-3 px-4">'Subscribe to our newsletter'</td><td class="py-3 px-4 text-neutral-600 dark:text-neutral-400">CTA heading</td></tr>
77
+ <tr><td class="py-3 px-4 font-mono text-xs">description</td><td class="py-3 px-4">String</td><td class="py-3 px-4">'Get the latest posts...'</td><td class="py-3 px-4 text-neutral-600 dark:text-neutral-400">Supporting text</td></tr>
78
+ <tr><td class="py-3 px-4 font-mono text-xs">button</td><td class="py-3 px-4">Object</td><td class="py-3 px-4">{ label: 'Subscribe' }</td><td class="py-3 px-4 text-neutral-600 dark:text-neutral-400">Button config { label, color? }</td></tr>
79
+ <tr><td class="py-3 px-4 font-mono text-xs">placeholder</td><td class="py-3 px-4">String</td><td class="py-3 px-4">'Enter your email'</td><td class="py-3 px-4 text-neutral-600 dark:text-neutral-400">Email input placeholder</td></tr>
80
+ <tr><td class="py-3 px-4 font-mono text-xs">variant</td><td class="py-3 px-4">String</td><td class="py-3 px-4">'default'</td><td class="py-3 px-4 text-neutral-600 dark:text-neutral-400">default, featured, inline, compact</td></tr>
81
+ <tr><td class="py-3 px-4 font-mono text-xs">icon</td><td class="py-3 px-4">String</td><td class="py-3 px-4">'i-lucide-mail'</td><td class="py-3 px-4 text-neutral-600 dark:text-neutral-400">Optional icon name</td></tr>
82
+ <tr><td class="py-3 px-4 font-mono text-xs">hasPrivacy</td><td class="py-3 px-4">Boolean</td><td class="py-3 px-4">true</td><td class="py-3 px-4 text-neutral-600 dark:text-neutral-400">Show privacy note</td></tr>
83
+ <tr><td class="py-3 px-4 font-mono text-xs">privacyText</td><td class="py-3 px-4">String</td><td class="py-3 px-4">'No spam. Unsubscribe anytime.'</td><td class="py-3 px-4 text-neutral-600 dark:text-neutral-400">Privacy note text</td></tr>
84
+ <tr><td class="py-3 px-4 font-mono text-xs">successMessage</td><td class="py-3 px-4">String</td><td class="py-3 px-4">'Thanks for subscribing!'</td><td class="py-3 px-4 text-neutral-600 dark:text-neutral-400">Message shown on success</td></tr>
85
+ </tbody>
86
+ </table>
87
+ </div>
88
+
89
+ <h2 class="text-lg font-semibold mt-12 mb-4">Events</h2>
90
+ <div class="space-y-4">
91
+ <div class="p-4 bg-neutral-50 dark:bg-neutral-800/50 rounded-lg">
92
+ <p class="font-mono text-sm text-primary-500">@submit</p>
93
+ <p class="text-sm text-neutral-600 dark:text-neutral-400 mt-1">Emitted with email address when newsletter form is submitted</p>
94
+ </div>
95
+ </div>
96
+ </div>
97
+
98
+ <!-- Code Example -->
99
+ <section>
100
+ <h2 class="text-lg font-semibold mb-4">Code Example</h2>
101
+ <CodeExample title="Blog Newsletter CTA" :code="codeExample" />
102
+ </section>
103
+ </div>
104
+ </div>
105
+ </template>
106
+
107
+ <script setup>
108
+ const codeExample = `<!-- Default -->
109
+ <XMarkBlogCTANewsletter
110
+ title="Enjoying this article?"
111
+ description="Subscribe to get notified."
112
+ :button="{ label: 'Subscribe' }"
113
+ @submit="handleSubscribe"
114
+ />
115
+
116
+ <!-- Featured -->
117
+ <XMarkBlogCTANewsletter
118
+ title="Join our newsletter"
119
+ :button="{ label: 'Subscribe Now' }"
120
+ variant="featured"
121
+ @submit="handleSubscribe"
122
+ />
123
+
124
+ <!-- Compact (for sidebars) -->
125
+ <XMarkBlogCTANewsletter
126
+ title="Subscribe"
127
+ :button="{ label: 'Join' }"
128
+ variant="compact"
129
+ @submit="handleSubscribe"
130
+ />`
131
+ </script>
@@ -0,0 +1,471 @@
1
+ <template>
2
+ <div class="min-h-screen">
3
+ <!-- Page Header -->
4
+ <div
5
+ class="bg-white dark:bg-neutral-900 border-b border-neutral-200 dark:border-neutral-800 px-8 py-6"
6
+ >
7
+ <h1 class="text-2xl font-bold text-neutral-900 dark:text-white">
8
+ Blog Detail
9
+ </h1>
10
+ <p class="mt-2 text-neutral-600 dark:text-neutral-400">
11
+ Full blog post view with sidebar, rich content, and navigation.
12
+ </p>
13
+ </div>
14
+
15
+ <!-- Demo: Full Layout -->
16
+ <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
17
+ <XMarkBlogDetail
18
+ :post="post"
19
+ :previous-post="previousPost"
20
+ :next-post="nextPost"
21
+ :toc="tableOfContents"
22
+ >
23
+ <template #default>
24
+ <article class="prose dark:prose-invert max-w-none">
25
+ <p class="lead">
26
+ Building a marketing website has never been easier. With modern
27
+ tools like Nuxt, Vue, and Tailwind CSS, developers can create
28
+ stunning, performant sites in record time. This guide walks you
29
+ through the essential patterns and best practices for crafting
30
+ marketing sites that convert.
31
+ </p>
32
+
33
+ <h2 id="getting-started">Getting Started</h2>
34
+ <p>
35
+ Before diving into the code, it's important to understand the core
36
+ principles that make marketing websites effective. These include
37
+ clear messaging, compelling visuals, and optimized performance.
38
+ </p>
39
+ <p>
40
+ The nuxt-x-marketing layer provides 33 production-ready components
41
+ specifically designed for marketing sites. From hero sections to
42
+ testimonials, each component is crafted with conversion in mind.
43
+ </p>
44
+
45
+ <h2 id="project-setup">Project Setup</h2>
46
+ <p>
47
+ Start by creating a new Nuxt project and adding the marketing
48
+ layer:
49
+ </p>
50
+
51
+ <XMarkCodeBlock :code="bashCode" language="bash" show-copy />
52
+
53
+ <p>Then configure your <code>nuxt.config.ts</code>:</p>
54
+
55
+ <XMarkCodeBlock
56
+ :code="nuxtConfigCode"
57
+ language="typescript"
58
+ show-copy
59
+ />
60
+
61
+ <h2 id="hero-sections">Creating Hero Sections</h2>
62
+ <p>
63
+ The hero section is the first thing visitors see. It needs to
64
+ capture attention immediately and communicate your value
65
+ proposition clearly.
66
+ </p>
67
+
68
+ <figure>
69
+ <img
70
+ src="https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=800&h=400&fit=crop"
71
+ alt="Dashboard design"
72
+ />
73
+ <figcaption>
74
+ A well-designed hero section can increase conversions by up to
75
+ 35%.
76
+ </figcaption>
77
+ </figure>
78
+
79
+ <p>Key elements of an effective hero section:</p>
80
+ <ul>
81
+ <li>
82
+ <strong>Clear headline</strong> — Communicate your main value
83
+ proposition in under 10 words
84
+ </li>
85
+ <li>
86
+ <strong>Supporting text</strong> — Expand on the headline with
87
+ 1-2 sentences
88
+ </li>
89
+ <li>
90
+ <strong>Strong CTA</strong> — Use action-oriented button text
91
+ </li>
92
+ <li>
93
+ <strong>Visual element</strong> — High-quality image or video
94
+ that reinforces the message
95
+ </li>
96
+ </ul>
97
+
98
+ <h2 id="social-proof">Adding Social Proof</h2>
99
+ <p>
100
+ Social proof is one of the most powerful conversion tools.
101
+ Testimonials, logos, and trust badges help establish credibility.
102
+ </p>
103
+
104
+ <blockquote>
105
+ "These components saved us weeks of development time. The quality
106
+ and attention to detail is outstanding."
107
+ <cite>— Sarah Chen, CTO at TechCorp</cite>
108
+ </blockquote>
109
+
110
+ <p>
111
+ Use the testimonials component to showcase customer feedback. The
112
+ grid layout works well for displaying multiple testimonials, while
113
+ the featured layout highlights a single powerful quote.
114
+ </p>
115
+
116
+ <h2 id="pricing-tables">Pricing Tables</h2>
117
+ <p>
118
+ Your pricing page is where conversions happen. Make it easy for
119
+ visitors to understand their options and choose the right plan.
120
+ </p>
121
+
122
+ <h3>Best Practices</h3>
123
+ <ol>
124
+ <li>Limit to 3-4 pricing tiers to avoid decision paralysis</li>
125
+ <li>Highlight the most popular or recommended plan</li>
126
+ <li>Use clear feature comparisons</li>
127
+ <li>Include trust badges near the pricing</li>
128
+ <li>Offer a money-back guarantee to reduce friction</li>
129
+ </ol>
130
+
131
+ <h2 id="performance">Performance Optimization</h2>
132
+ <p>
133
+ Performance directly impacts conversions. Studies show that a
134
+ <mark>1-second delay</mark> in page load time can result in a
135
+ <strong>7% reduction</strong> in conversions.
136
+ </p>
137
+
138
+ <p>The marketing layer includes built-in optimizations:</p>
139
+
140
+ <div class="not-prose">
141
+ <UTable
142
+ :data="performanceData"
143
+ :columns="performanceColumns"
144
+ class="flex-1"
145
+ />
146
+ </div>
147
+
148
+ <hr />
149
+
150
+ <h2 id="conclusion">Conclusion</h2>
151
+ <p>
152
+ Building effective marketing websites requires the right
153
+ combination of design, performance, and conversion optimization.
154
+ With nuxt-x-marketing, you get battle-tested components that
155
+ handle the heavy lifting, letting you focus on your content and
156
+ messaging.
157
+ </p>
158
+ <p>
159
+ Ready to get started? Check out the
160
+ <a href="/content/features">features documentation</a> or browse
161
+ the <a href="/">component library</a> to see what's available.
162
+ </p>
163
+ </article>
164
+ </template>
165
+
166
+ <!-- Custom Sidebar Content -->
167
+ <template #sidebar>
168
+ <XMarkBlogSidebar
169
+ :categories="categories"
170
+ :tags="tags"
171
+ :recent-posts="recentPosts"
172
+ :has-search="true"
173
+ :has-cta="true"
174
+ />
175
+ </template>
176
+ </XMarkBlogDetail>
177
+ </div>
178
+
179
+ <!-- Props Documentation -->
180
+ <div class="border-t border-neutral-200 dark:border-neutral-800">
181
+ <div class="max-w-4xl mx-auto px-8 py-12">
182
+ <h2 class="text-lg font-semibold mb-6">Blog Detail Props</h2>
183
+ <div class="not-prose">
184
+ <UTable :data="propsData" :columns="propsColumns" class="flex-1" />
185
+ </div>
186
+
187
+ <h2 class="text-lg font-semibold mt-12 mb-6">Slots</h2>
188
+ <div class="not-prose">
189
+ <UTable :data="slotsData" :columns="slotsColumns" class="flex-1" />
190
+ </div>
191
+
192
+ <h2 class="text-lg font-semibold mt-12 mb-6">Post Object Structure</h2>
193
+ <div
194
+ class="bg-neutral-100 dark:bg-neutral-800 rounded-lg p-4 text-sm font-mono overflow-x-auto"
195
+ >
196
+ <pre>
197
+ {
198
+ title: "Post Title",
199
+ excerpt: "Brief description...",
200
+ img: { src: "https://...", alt: "Image description" },
201
+ date: "2024-01-15",
202
+ readingTime: "5 min read",
203
+ category: "Tutorial",
204
+ author: {
205
+ name: "Author Name",
206
+ avatar: "https://...",
207
+ bio: "Author bio...",
208
+ twitter: "@handle"
209
+ }
210
+ }</pre
211
+ >
212
+ </div>
213
+
214
+ <h2 class="text-lg font-semibold mt-12 mb-4">Code Example</h2>
215
+ <CodeExample title="Blog Detail Usage" :code="codeExample" />
216
+ </div>
217
+ </div>
218
+ </div>
219
+ </template>
220
+
221
+ <script setup>
222
+ import { h, resolveComponent } from "vue";
223
+
224
+ // Code examples for Shiki highlighting
225
+ const bashCode = `# Create new project
226
+ npx nuxi init my-marketing-site
227
+ cd my-marketing-site
228
+
229
+ # Install dependencies
230
+ npm install
231
+
232
+ # Add the marketing layer
233
+ npm install @xenterprises/nuxt-x-marketing`;
234
+
235
+ const nuxtConfigCode = `export default defineNuxtConfig({
236
+ extends: ['@xenterprises/nuxt-x-marketing'],
237
+
238
+ modules: ['@nuxt/ui'],
239
+
240
+ app: {
241
+ head: {
242
+ title: 'My Marketing Site'
243
+ }
244
+ }
245
+ })`;
246
+
247
+ const codeExample = `<!-- With Nuxt Content v3 -->
248
+ <script setup>
249
+ const route = useRoute()
250
+
251
+ // Fetch post
252
+ const { data: post } = await useAsyncData('post', () =>
253
+ queryCollection('blog')
254
+ .where('slug', '=', route.params.slug)
255
+ .findOne()
256
+ )
257
+
258
+ // Fetch navigation
259
+ const { data: surround } = await useAsyncData('surround', () =>
260
+ queryCollectionItemSurroundings('blog', route.path)
261
+ )
262
+ <\/script>
263
+
264
+ <template>
265
+ <XMarkBlogDetail
266
+ :post="post"
267
+ :previous-post="surround?.[0]"
268
+ :next-post="surround?.[1]"
269
+ :toc="post?.body?.toc?.links || []"
270
+ >
271
+ <ContentRenderer :value="post" />
272
+
273
+ <template #sidebar>
274
+ <XMarkBlogSidebar
275
+ :categories="categories"
276
+ :recent-posts="recentPosts"
277
+ />
278
+ </template>
279
+ </XMarkBlogDetail>
280
+ </template>`;
281
+
282
+ // Performance table data
283
+ const performanceData = ref([
284
+ { feature: "Lazy loading", benefit: "Images load only when visible" },
285
+ { feature: "CSS purging", benefit: "Only used styles are shipped" },
286
+ { feature: "Component splitting", benefit: "Components load on demand" },
287
+ { feature: "Font optimization", benefit: "Fonts preloaded and subset" },
288
+ ]);
289
+
290
+ const performanceColumns = [
291
+ {
292
+ accessorKey: "feature",
293
+ header: "Feature",
294
+ cell: ({ row }) => row.getValue("feature"),
295
+ },
296
+ {
297
+ accessorKey: "benefit",
298
+ header: "Benefit",
299
+ cell: ({ row }) => row.getValue("benefit"),
300
+ },
301
+ ];
302
+
303
+ // Props documentation table data
304
+ const propsData = ref([
305
+ {
306
+ prop: "post",
307
+ type: "Object",
308
+ default: "required",
309
+ description:
310
+ "Post object with title, img: { src, alt? }, date, author, etc.",
311
+ },
312
+ {
313
+ prop: "previousPost",
314
+ type: "Object",
315
+ default: "null",
316
+ description: "Previous post for navigation",
317
+ },
318
+ {
319
+ prop: "nextPost",
320
+ type: "Object",
321
+ default: "null",
322
+ description: "Next post for navigation",
323
+ },
324
+ {
325
+ prop: "toc",
326
+ type: "Array",
327
+ default: "[]",
328
+ description: "Table of contents [{ id, text, depth }]",
329
+ },
330
+ ]);
331
+
332
+ const propsColumns = [
333
+ {
334
+ accessorKey: "prop",
335
+ header: "Prop",
336
+ cell: ({ row }) =>
337
+ h("code", { class: "text-xs font-mono" }, row.getValue("prop")),
338
+ },
339
+ {
340
+ accessorKey: "type",
341
+ header: "Type",
342
+ cell: ({ row }) => row.getValue("type"),
343
+ },
344
+ {
345
+ accessorKey: "default",
346
+ header: "Default",
347
+ cell: ({ row }) => row.getValue("default"),
348
+ },
349
+ {
350
+ accessorKey: "description",
351
+ header: "Description",
352
+ cell: ({ row }) => row.getValue("description"),
353
+ },
354
+ ];
355
+
356
+ // Slots table data
357
+ const slotsData = ref([
358
+ { slot: "default", description: "Main article content (prose)" },
359
+ {
360
+ slot: "sidebar",
361
+ description: "Custom sidebar content (overrides default)",
362
+ },
363
+ ]);
364
+
365
+ const slotsColumns = [
366
+ {
367
+ accessorKey: "slot",
368
+ header: "Slot",
369
+ cell: ({ row }) =>
370
+ h("code", { class: "text-xs font-mono" }, row.getValue("slot")),
371
+ },
372
+ {
373
+ accessorKey: "description",
374
+ header: "Description",
375
+ cell: ({ row }) => row.getValue("description"),
376
+ },
377
+ ];
378
+
379
+ // Main post
380
+ const post = {
381
+ title: "Building Modern Marketing Sites with Nuxt",
382
+ excerpt:
383
+ "A comprehensive guide to creating beautiful, performant marketing websites using Vue, Nuxt, and modern web technologies.",
384
+ img: {
385
+ src: "https://images.unsplash.com/photo-1519389950473-47ba0277781c?w=1200&h=600&fit=crop",
386
+ alt: "Team working on laptops",
387
+ },
388
+ date: "2024-01-15",
389
+ readingTime: "8 min read",
390
+ category: "Tutorial",
391
+ author: {
392
+ name: "Sarah Chen",
393
+ avatar:
394
+ "https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=100&h=100&fit=crop",
395
+ bio: "Sarah is a frontend developer specializing in Vue and Nuxt. She writes about web development and design systems.",
396
+ twitter: "@sarahchen",
397
+ },
398
+ };
399
+
400
+ // Navigation posts
401
+ const previousPost = {
402
+ title: "Introduction to Vue 3 Composition API",
403
+ slug: "vue-composition-api",
404
+ };
405
+
406
+ const nextPost = {
407
+ title: "Optimizing Nuxt for Production",
408
+ slug: "nuxt-production-optimization",
409
+ };
410
+
411
+ // Table of contents
412
+ const tableOfContents = [
413
+ { id: "getting-started", text: "Getting Started", depth: 2 },
414
+ { id: "project-setup", text: "Project Setup", depth: 2 },
415
+ { id: "hero-sections", text: "Creating Hero Sections", depth: 2 },
416
+ { id: "social-proof", text: "Adding Social Proof", depth: 2 },
417
+ { id: "pricing-tables", text: "Pricing Tables", depth: 2 },
418
+ { id: "performance", text: "Performance Optimization", depth: 2 },
419
+ { id: "conclusion", text: "Conclusion", depth: 2 },
420
+ ];
421
+
422
+ // Sidebar data
423
+ const categories = [
424
+ { name: "Tutorial", slug: "tutorial", count: 12 },
425
+ { name: "Guide", slug: "guide", count: 8 },
426
+ { name: "Design", slug: "design", count: 6 },
427
+ { name: "Performance", slug: "performance", count: 4 },
428
+ { name: "News", slug: "news", count: 3 },
429
+ ];
430
+
431
+ const tags = [
432
+ { name: "Nuxt", slug: "nuxt" },
433
+ { name: "Vue", slug: "vue" },
434
+ { name: "Tailwind CSS", slug: "tailwind" },
435
+ { name: "Components", slug: "components" },
436
+ { name: "Marketing", slug: "marketing" },
437
+ { name: "SEO", slug: "seo" },
438
+ { name: "Performance", slug: "performance" },
439
+ { name: "Design", slug: "design" },
440
+ ];
441
+
442
+ const recentPosts = [
443
+ {
444
+ title: "Dark Mode Best Practices",
445
+ slug: "dark-mode",
446
+ img: {
447
+ src: "https://images.unsplash.com/photo-1555066931-4365d14bab8c?w=200&h=200&fit=crop",
448
+ alt: "Dark mode",
449
+ },
450
+ date: "2024-01-10",
451
+ },
452
+ {
453
+ title: "Building a Landing Page in 10 Minutes",
454
+ slug: "landing-page-tutorial",
455
+ img: {
456
+ src: "https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=200&h=200&fit=crop",
457
+ alt: "Landing page",
458
+ },
459
+ date: "2024-01-05",
460
+ },
461
+ {
462
+ title: "CSS Grid vs Flexbox: When to Use Each",
463
+ slug: "css-grid-flexbox",
464
+ img: {
465
+ src: "https://images.unsplash.com/photo-1517694712202-14dd9538aa97?w=200&h=200&fit=crop",
466
+ alt: "CSS layout",
467
+ },
468
+ date: "2024-01-02",
469
+ },
470
+ ];
471
+ </script>