Comments (3)
Please just use an img tag, I think NuxtImg has issues .
You don't need the responsiveness or the resizing
from og-image.
Okay I find something !
I changed my OG image template and I define width height and sizes in nuxtImg
<template>
<div class="h-screen w-full flex flex-col items-center bg-cover bg-top bg-no-repeat" :style="{ backgroundImage: 'url(https://henoo.fr/pictures/illustrations/landing/cloud.png)' }">
<div class="flex flex-col items-center flex-grow justify-center">
<!-- edited this balise 👇 -->
<NuxtImg
v-if="picture"
class="size-40 rounded-full mb-6"
alt="user profile picture"
:src="picture"
width="150"
height="150"
sizes="xs:200px sm:210px md:220px lg:230px xl:240px xxl:250px '2xl':260px"
/>
<div class="text-3xl text-center !font-semibold my-6">
{{ userName }} t'invite à sortir
</div>
</div>
<div class="mb-6">
<NuxtImg src="https://henoo.fr/logo/logo_text.png" class="h-12" />
</div>
</div>
</template>
Know I don't have the 500 error. But unfortunately the image whose tag I've modified doesn't appear in the final image.
I looked at my server logs and I have :
Can't load image http://web-dev.henoo.fr/_ipx/s_500x500/https://filesdev.henoo.fr/user/16616_1721310762248?1722417805412: fetch failed
If I load the full link in my browser I get the image. That's all that's left. The server-side module can't get the image.
from og-image.
Yeah it's what I tried it's working fine now 👍
It's weird because the second works properly.
In any case, thank you very much for this package 🩵
**Final code**
<template>
<div class="h-screen w-full flex flex-col items-center bg-cover bg-top bg-no-repeat" :style="{ backgroundImage: 'url(https://henoo.fr/pictures/illustrations/landing/cloud.png)' }">
<div class="flex flex-col items-center flex-grow justify-center">
<img
v-if="picture"
class="size-40 rounded-full mb-6"
alt="user profile picture"
:src="picture"
width="150"
height="150"
>
<div class="text-3xl text-center !font-semibold my-6" v-text="`${userName} t'invite à sortir`" />
</div>
<div class="mb-6">
<NuxtImg src="https://henoo.fr/logo/logo_text.png" class="h-12" />
</div>
</div>
</template>
<script setup lang="ts">
withDefaults(defineProps<{ userName?: string, picture?: string }>(), { userName: 'Ton pote', picture: undefined })
</script>
from og-image.
Related Issues (20)
- Having `@nuxt/image` dependency installed throws error on Nuxt restart (in dev mode) HOT 3
- satoriOptions width and height crop the image instead of reducing resolution
- How to Upload images to Cloudflare Images HOT 5
- Using nuxt-18n inside og-image component HOT 5
- Can't set headline on Pergel example
- `baseURL` get duplicated for the url of `og:image` HOT 5
- Adding a custom font doesn't disable the previous added fonts HOT 2
- Seems so have issues with [email protected] HOT 3
- Can't use the image generation : Get 404 Page not found: /__nuxt-og-image HOT 3
- Nuxt config default url does not apply for clean defineOgImage
- Using <slot> in a component causes OgImage generation issues
- Circular export in `useNitroApp` HOT 2
- Error: Could not load /github/workspace/node_modules/@css-inline/css-inline-wasm/index_bg.wasm?module HOT 2
- Gradient HOT 1
- Support .webp images? Currently this causes a server error 500 HOT 2
- fix: vercel serverless function crashing
- Setting Colorscheme to `dark` for `NuxtSeo` template doesn't make the text a light color.
- feat: Support Arabic language
- fix: Duplicated Import HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from og-image.