Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ Click tracking: `capture(event, { position, variant, plan? })` via `nuxt/composa
- **`.handbook-content a` must exclude Nuxt UI components, or use `:where()`.** A plain `.handbook-content a { color: ... }` rule (even layered) beats a `UButton`'s own utility classes if it has higher specificity, flattening any Cta* button rendered inside handbook markdown to a plain link color. Fixed by moving the rule into `@layer base` and using `:where(a)` to zero out its added specificity, so any component's own classes win normally (same file as above).
- **`not-prose` on a wrapper also strips Tailwind Typography's code-block styling** (the dark background on `<pre>`) for anything nested inside it, not just its own prose text styling. `nuxt/components/content/CtaExample.vue` (the handbook's live example gallery) doesn't use `not-prose` for this reason, even though it also renders non-prose button/grid markup.
- **The `ui` prop override doesn't reach compoundVariants-driven classes.** The gotcha above (full-string replacement) only applies to the app.config-level base extension; UButton's own `variant`/`color`-driven classes (e.g. `ghost`'s `hover:bg-{color}/10`) are computed separately and still get merged in via `tv()` regardless of what `ui.base` says. `CtaButton.vue`'s ghost color classes explicitly add `hover:bg-transparent` to cancel that default hover background, since a ghost CTA should have none at all.
- **UButton's `to` prop treats any same-origin-looking path as a Nuxt route, even if Nuxt doesn't serve it.** `CtaContactUs`/`CtaBookDemo` point at `/contact-us/` and `/book-demo/`, which are still 11ty — without `external`, clicking does a client-side Vue Router navigation instead of a real page load, and 404s instead of reaching the server-side 11ty proxy. `CtaButton.vue` takes a fixed (non-caller-configurable) `external` prop per destination; `CtaContactUs`/`CtaBookDemo` set it `true`, `CtaSignUp`/`CtaSignIn` set it `false` (moot — those hrefs are already cross-origin). **When `/contact-us/` or `/book-demo/` actually migrates to Nuxt, flip that destination's `external` to `false`** — leaving it `true` would keep forcing a full page reload where a client-side nav would work fine.
- **UButton's `to` prop treats any same-origin-looking path as a Nuxt route, even if Nuxt doesn't serve it.** `CtaButton.vue` takes a fixed (non-caller-configurable) `external` prop per destination, set by each `Cta*` wrapper — `true` when the href still points at an 11ty-served route (would otherwise 404 via client-side Vue Router instead of reaching the 11ty proxy), `false` once that route is served by Nuxt. `CtaContactUs`/`CtaBookDemo` now set `false` — `/contact-us` and `/book-demo` are Nuxt routes (`nuxt/pages/contact-us/index.vue`, `nuxt/pages/book-demo/index.vue`). `CtaSignUp`/`CtaSignIn` set `false` too, moot since those hrefs are already cross-origin.

## Naming conventions

Expand Down
4 changes: 1 addition & 3 deletions nuxt/components/CtaBookDemo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ withDefaults(defineProps<{
const EVENT = 'cta-book-demo'
const HREF = '/book-demo/'
const LABEL = 'Book a Demo'
// /book-demo/ is still served by 11ty, not a Nuxt route - see CtaButton.vue's
// `external` prop.
</script>

<template>
<CtaButton :event="EVENT" :href="HREF" :external="true" :label="LABEL" :variant="variant" :position="position" :plan="plan" :icon="icon" :uppercase="uppercase" :padded="padded" :color="color" :preview="preview" />
<CtaButton :event="EVENT" :href="HREF" :external="false" :label="LABEL" :variant="variant" :position="position" :plan="plan" :icon="icon" :uppercase="uppercase" :padded="padded" :color="color" :preview="preview" />
</template>
4 changes: 1 addition & 3 deletions nuxt/components/CtaContactUs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ withDefaults(defineProps<{
const EVENT = 'cta-contact-us'
const HREF = '/contact-us/'
const LABEL = 'Contact Us'
// /contact-us/ is still served by 11ty, not a Nuxt route - see CtaButton.vue's
// `external` prop.
</script>

<template>
<CtaButton :event="EVENT" :href="HREF" :external="true" :label="LABEL" :variant="variant" :position="position" :plan="plan" :icon="icon" :uppercase="uppercase" :padded="padded" :color="color" :preview="preview" />
<CtaButton :event="EVENT" :href="HREF" :external="false" :label="LABEL" :variant="variant" :position="position" :plan="plan" :icon="icon" :uppercase="uppercase" :padded="padded" :color="color" :preview="preview" />
</template>
15 changes: 13 additions & 2 deletions nuxt/components/HubSpotForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const props = defineProps<{
const containerId = `hs-form-${props.formId.replace(/-/g, '')}`
const region = props.region ?? 'eu1'
const portalId = props.portalId ?? '26586079'
const showFallback = ref(false)

function loadScript(): Promise<void> {
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -48,11 +49,21 @@ onMounted(async () => {
} : {}),
})
} catch {
// silently fail if HubSpot cannot load
showFallback.value = true
}
})
</script>

<template>
<div :id="containerId" />
<div>
<div :id="containerId" />
<div v-if="showFallback" class="ff-hubspot-consent-fallback text-center border bg-red-50/25 border-red-300 rounded-lg px-6 pt-8 pb-4">
<p class="text-red-400">
<strong>Hmm… there was supposed to be a form here</strong>
</p>
<p class="text-gray-600">
If this form does not load, try adjusting your privacy settings or switching browsers.
</p>
</div>
</div>
</template>
62 changes: 62 additions & 0 deletions nuxt/components/HubSpotMeetings.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<script setup lang="ts">
// Ported from src/_includes/hubspot/hs-book-meeting.njk. Loading the meetings
// embed is gated behind analytics consent: src/js/cookieconsent-config.js
// (compiled into /js/cc.min.js, injected globally by nuxt/server/plugins/analytics.ts)
// calls window._ffLoadMeetings() from its onConsent/onFirstConsent handlers
// once analytics cookies are accepted - both on this page's load and on a
// later consent change. Until then, the fallback box below stays visible.
const props = defineProps<{
dataSrc: string
}>()

const fallbackId = 'meetings-consent-placeholder'

onMounted(() => {
(window as any)._ffLoadMeetings = function () {
const placeholder = document.getElementById(fallbackId)
if (!placeholder?.parentNode) return

const parent = placeholder.parentNode

const container = document.createElement('div')
container.className = 'meetings-iframe-container -mb-20 md:-mb-6'
container.setAttribute('data-src', props.dataSrc)
parent.insertBefore(container, placeholder)

const script = document.createElement('script')
script.src = 'https://static.hsappstatic.net/MeetingsEmbed/ex/MeetingsEmbedCode.js'
script.onload = () => { placeholder.remove() }
script.onerror = () => { placeholder.classList.remove('hidden') }
parent.insertBefore(script, placeholder)
;(window as any)._ffLoadMeetings = null
}
})
</script>

<template>
<div>
<div :id="fallbackId" class="ff-hubspot-consent-fallback text-center border bg-indigo-900 rounded-lg px-6 pt-8 pb-4">
<h4 class="text-white font-medium">
Choose a time to talk
</h4>
<p class="text-indigo-200">
30-minute session with our team.
</p>
<a
href="https://meetings-eu1.hubspot.com/michael-davis/round-robin-sales-team"
class="inline-block ff-btn ff-btn--highlight uppercase mb-2"
style="cursor: pointer;"
@click="() => (typeof (window as any).capture === 'function') && (window as any).capture('calendar_fallback_cta_clicked')"
>
Pick a time →
</a>
<p class="mt-4 text-indigo-200 italic font-xs">
Prefer to view availability on this page?<br>
<a
class="cursor-pointer text-indigo-200 underline"
@click="() => (window as any).CookieConsent && (window as any).CookieConsent.showPreferences()"
>Enable analytics cookies.</a>
</p>
</div>
</div>
</template>
58 changes: 58 additions & 0 deletions nuxt/components/MqlContactPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<script setup lang="ts">
// Ported from src/_includes/layouts/mql-contact.njk. The form/meeting embed
// is passed via the default slot since the two consumers (contact-us,
// book-demo) use different HubSpot embeds (form vs meetings calendar).
defineProps<{
title: string
description: string
otherChannels: Array<{
title: string
description: string
buttonText: string
buttonLink: string
icon: string
}>
}>()
</script>

<template>
<div class="container m-auto max-w-5xl px-6 pb-16 pt-16">
<div class="flex flex-col md:grid md:grid-cols-2 gap-8 md:gap-x-12">
<div class="order-1 text-center md:text-left md:col-start-1 md:row-start-1 min-w-0">
<h1 class="text-indigo-600 mt-0">
{{ title }}
</h1>
<!-- eslint-disable-next-line vue/no-v-html -->
<p class="text-gray-500 mt-3" v-html="description" />
</div>

<div class="order-2 md:col-start-2 md:row-start-1 md:row-span-2 min-w-0 overflow-hidden">
<slot />
</div>

<div class="order-4 md:col-start-1 md:row-start-2 min-w-0">
<div class="flex flex-col gap-12">
<div v-for="channel in otherChannels" :key="channel.title" class="flex flex-col items-center md:items-start">
<div class="flex flex-col items-center md:items-start gap-2 mb-2">
<UIcon :name="`i-lucide-${channel.icon}`" class="w-8 h-8 text-indigo-400" />
<h4 class="text-indigo-400 m-0 text-lg font-medium">
{{ channel.title }}
</h4>
</div>
<p class="text-gray-500 mb-2 text-center md:text-left">
{{ channel.description }}
</p>
<a :href="channel.buttonLink" class="text-blue-600 inline-flex items-center gap-1 mt-4">
{{ channel.buttonText }}
<UIcon name="i-lucide-move-right" class="w-4 h-4" />
</a>
</div>
</div>
</div>

<div class="order-3 md:col-start-1 md:col-span-2 md:row-start-3 min-w-0 border-t border-gray-200 pt-6">
<SocialProof />
</div>
</div>
</div>
</template>
110 changes: 110 additions & 0 deletions nuxt/components/ThankYouExploreMore.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<script setup lang="ts">
import { isFuturePost } from '~/composables/useBlogList'

const props = defineProps<{
readingResources?: string
collectionName?: string
downloadFollowUp?: boolean
hubspotReference: string
}>()

const { data: blogPosts } = await useAsyncData(`thank-you-blog-${props.collectionName || 'all'}`, async () => {
const all = await queryCollection('blog')
.select('path', 'title', 'date', 'tags')
.order('date', 'DESC')
.all()
return all
.filter(post => !isFuturePost(post.date) && (!props.collectionName || (post.tags || []).includes(props.collectionName)))
.slice(0, 3)
})

// Mirrors explore-more-content.njk: takes the single latest-dated webinar overall
// (not "next upcoming or most recent past"), then checks if that one date is in the future.
const { data: webinar } = await useAsyncData('thank-you-webinar', async () => {
const all = await queryCollection('webinars')
.select('path', 'title', 'date', 'time')
.order('date', 'DESC')
.limit(1)
.all()
return all[0] ?? null
})

const webinarIsUpcoming = computed(() => webinar.value && new Date(webinar.value.date) >= new Date())

const blogListUrl = computed(() => `/blog/${props.collectionName || ''}`)
</script>

<template>
<div>
<template v-if="readingResources === 'stories'">
<ThankYouStoriesBlock />
<h4 class="mt-20 w-full text-center text-gray-500 pt-12 border-t">
Learn more about how FlowFuse helps with your industrial data applications
</h4>
</template>

<div class="w-full max-w-md md:max-w-none mx-auto flex flex-col md:grid md:grid-cols-3 gap-6 md:gap-x-8 pt-8">
<div class="w-full my-2 grid grid-cols-1 pb-4">
<div class="pb-2 md:pb-0">
<a href="/blog/">
<img src="/images/home/blog.png" alt="Image of hands typing on laptop working on Node-RED flows" class="w-full max-w-[448px] mx-auto mb-4 aspect-video object-cover rounded-lg">
</a>
<h3 class="text-xl font-bold pb-3">
Latest on the blog
</h3>
<a v-for="(post, index) in blogPosts" :key="post.path" :href="post.path" class="w-full flex flex-col group" :class="{ 'border-b': index !== (blogPosts?.length ?? 0) - 1 }">
<h4 class="my-2 font-light text-lg">
<span class="text-gray-500 group-hover:text-blue-700">{{ post.title }}</span>
</h4>
</a>
</div>
<a :href="blogListUrl" class="group hover:no-underline w-full text-right flex flex-row items-center justify-end gap-1">
<span class="group-hover:underline">See all</span>
<UIcon name="i-lucide-arrow-right" class="w-5 h-5 shrink-0" />
</a>
</div>

<div v-if="webinar" class="w-full my-2 grid grid-cols-1 pb-4">
<div class="pb-2 md:pb-0">
<a :href="webinar.path">
<img src="/images/home/webinar.png" alt="Image of hands typing on laptop working on Node-RED flows" class="w-full max-w-[448px] mx-auto mb-4 aspect-video object-cover rounded-lg">
</a>
<h3 class="text-xl font-bold pb-3">
{{ webinarIsUpcoming ? 'Upcoming' : 'Latest' }} Webinar
</h3>
<div class="w-full flex flex-col">
<h4 class="my-2 font-light text-lg">
<span class="text-gray-500">{{ webinar.title }}</span>
</h4>
</div>
<div class="w-full border-t pt-3 font-light text-gray-500">
<time :datetime="webinar.date">{{ new Date(webinar.date).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }) }}</time>
<template v-if="webinarIsUpcoming && webinar.time">
&nbsp;|&nbsp;<time>{{ webinar.time }}</time>
</template>
</div>
</div>
<a
:href="webinar.path"
class="mt-4 ff-btn uppercase inline-block self-end justify-self-end"
:class="downloadFollowUp ? 'ff-btn--primary' : 'ff-btn--primary-outlined'"
>{{ webinarIsUpcoming ? 'REGISTER NOW' : 'WATCH WEBINAR' }}</a>
</div>

<div class="w-full my-2 grid grid-cols-1">
<div class="pb-2 md:pb-0">
<img src="/images/home/newsletter.png" alt="Image of hands typing on laptop working on Node-RED flows" class="w-full max-w-[448px] mx-auto mb-4 aspect-video object-cover rounded-lg">
<h3 class="text-xl font-bold pb-3">
Newsletter
</h3>
<h4 class="font-bold pb-3 pt-2 text-lg">
Sign up for our monthly email updates
</h4>
</div>
<div class="-mb-1 self-end w-full">
<HubSpotForm form-id="159c173d-dd95-49bd-922b-ff3ef243e90c" cta="cta-blog-subscribe" :reference="hubspotReference" />
</div>
</div>
</div>
</div>
</template>
39 changes: 39 additions & 0 deletions nuxt/components/ThankYouStoriesBlock.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<script setup lang="ts">
// Ported from src/_includes/stories-block.njk + src/_includes/stories/customer-story.njk.
// The random pick happens inside useAsyncData's fetcher (server-only), so the result is
// serialized once and reused on the client - re-shuffling in the template would cause a
// hydration mismatch.
const { data: stories } = await useAsyncData('thank-you-stories', async () => {
const all = await queryCollection('stories')
.select('path', 'title', 'image', 'logo', 'story')
.all()
return all
.map(story => ({ sort: Math.random(), story }))
.sort((a, b) => a.sort - b.sort)
.slice(0, 3)
.map(({ story }) => story)
})
</script>

<template>
<ul class="w-full max-w-md md:max-w-none mx-auto flex flex-col md:grid md:grid-cols-3 gap-3 md:gap-x-4 pt-8">
<li v-for="story in stories" :key="story.path" class="w-full my-2 border rounded-lg hover:drop-shadow-lg hover:border-blue-600 transition ease-in-out duration-300 bg-white">
<a :href="story.path" class="w-full flex flex-col group hover:no-underline h-full m-0">
<div class="relative border-b">
<div class="w-full h-52 sm:h-48 overflow-hidden rounded-t-lg">
<img :src="story.image || '/images/og-blog.jpg'" :alt="`Image representing ${story.title}`" class="w-full h-full object-cover">
</div>
<div v-if="story.logo" class="w-1/2 h-full absolute left-0 top-0 bg-white flex items-center justify-center rounded-tl-lg">
<img :src="story.logo" :alt="`${story.story?.brand} logo`" class="max-w-[70%] max-h-[70%] object-contain">
</div>
</div>
<div class="flex flex-col mt-1 mb-0 p-5 pt-3 gap-2">
<span class="font-bold text-gray-600">{{ story.story?.brand }}</span>
<h3 class="group-hover:text-blue-600 font-medium m-0 mt-0 mb-2 text-lg leading-relaxed">
{{ story.title }}
</h3>
</div>
</a>
</li>
</ul>
</template>
32 changes: 32 additions & 0 deletions nuxt/content.config.ts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ZJvandeWeg I'm not sure if this was meant to be included in this PR, the title and description only talk about contact us and book a demo. Was this intentional?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, intentional — the title/description have been updated to reflect that this PR also migrates /thank-you/*.

Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,38 @@ export default defineContentConfig({
sitemap: defineSitemapSchema(),
})
}),
// Source files stay at src/customer-stories/ (still served by 11ty, see
// LEGACY_PREFIXES in nuxt/server/middleware/legacy.ts) - this collection only
// feeds the ThankYouStoriesBlock tiles, it isn't rendered as Nuxt pages, so it
// deliberately has no `sitemap` field.
stories: defineCollection({
type: 'page',
source: {
cwd: join(__dirname, '../src'),
include: 'customer-stories/*.md',
},
schema: z.object({
image: z.string().optional(),
logo: z.string().optional(),
story: z.object({
brand: z.string(),
}),
})
}),
// Source files stay at src/webinars/ (still served by 11ty, see LEGACY_PREFIXES
// in nuxt/server/middleware/legacy.ts) - only queried for the "Latest/Upcoming
// Webinar" tile on the thank-you pages, so no `sitemap` field either.
webinars: defineCollection({
type: 'page',
source: {
cwd: join(__dirname, '../src'),
include: 'webinars/**/*.md',
},
schema: z.object({
date: z.coerce.date(),
time: z.string().optional(),
})
}),
ebooks: defineCollection({
type: 'page',
source: 'ebooks/*.md',
Expand Down
3 changes: 3 additions & 0 deletions nuxt/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ export default defineNuxtConfig({
routeRules: {
'/terms': { robots: false },
'/privacy-policy': { robots: false },
'/thank-you/**': { robots: false },
...redirects,
},

Expand Down Expand Up @@ -316,6 +317,8 @@ export default defineNuxtConfig({
'/integrations',
'/pricing',
'/product',
'/contact-us',
'/book-demo',
'/ebooks/beginner-guide-to-a-professional-nodered/',
'/ebooks/ultimate-guide-to-building-applications-with-flowfuse-dashboard-for-node-red/',
'/whitepaper/uns-decoupling-data-producers-and-consumers/',
Expand Down
Loading