Skip to content
Merged
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
29 changes: 14 additions & 15 deletions nuxt/components/LiteYoutube.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@ const props = defineProps<{
title: string
}>()

onMounted(() => {
if (!document.querySelector('script[src*="lite-yt-embed"]')) {
const script = document.createElement('script')
script.async = true
script.src = 'https://cdn.jsdelivr.net/npm/lite-youtube-embed@0.2.0/src/lite-yt-embed.min.js'
document.head.appendChild(script)
}
if (!document.querySelector('link[href*="lite-yt-embed"]')) {
const link = document.createElement('link')
link.rel = 'stylesheet'
link.href = 'https://cdn.jsdelivr.net/npm/lite-youtube-embed@0.2.0/src/lite-yt-embed.min.css'
link.crossOrigin = 'anonymous'
link.referrerPolicy = 'no-referrer'
document.head.appendChild(link)
}
// Register stylesheet and script via useHead so they're present in the initial SSR HTML.
// This ensures the lite-youtube-embed layout/poster CSS is applied before hydration,
// preventing layout shift on pages like /platform/why-flowfuse.
useHead({
link: [{
rel: 'stylesheet',
href: 'https://cdn.jsdelivr.net/npm/lite-youtube-embed@0.2.0/src/lite-yt-embed.min.css',
crossorigin: 'anonymous',
referrerpolicy: 'no-referrer',
}],
script: [{
src: 'https://cdn.jsdelivr.net/npm/lite-youtube-embed@0.2.0/src/lite-yt-embed.min.js',
async: true,
}],
})
</script>

Expand Down
2 changes: 1 addition & 1 deletion nuxt/pages/platform/why-flowfuse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ useSchemaOrg([
<div class="grid grid-cols-1 lg:grid-cols-[1fr_2fr] gap-6">
<div class="flex-grow relative hidden lg:block">
<div class="ff-image-cover left ff-image-rounded w-full h-full">
<img src="/images/why-flowfuse/from-prototype-to-production.png" alt="Shop floor office" width="496" class="w-full h-auto">
<NuxtImg src="/images/why-flowfuse/from-prototype-to-production.png" alt="Shop floor office" :width="496" format="webp" loading="lazy" class="w-full h-auto" />
</div>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-6">
Expand Down
Loading