Next.js Discord

Discord Forum

website link isn't showing metadata when pasting it in discord?

Answered
futuredevengineer posted this in #help-forum
Open in Discord
Avatar
 <head>
        <meta name="twitter:card" content='summary'/>
        <meta name="twitter:title" content="Welcome to my Portfolio"/>
        <meta name='twtter:description' content='A Passionate Software Engineer'/>
        <meta name='twitter:image' content='./mainimg.png' />
        <meta name='twitter:author' content='Name here'/>
        </head>


i put this layout.tsx, however I am wondering what the difference between Next's Head and native head?
Answered by futuredevengineer
Now i am trying paste the meta tags into page.tsx, considering it is server component, let's see...
View full answer

12 Replies

Avatar
Now i am trying paste the meta tags into page.tsx, considering it is server component, let's see...
Answer
Avatar
it worked.
Avatar
@alfonsus consider using the `metadata` API instead
Avatar
How does that work with Twitter meta data? I want to create Twitter card
Avatar
@alfonsus https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadata-object https://nextjs.org/docs/app/api-reference/file-conventions/metadata/opengraph-image#twitter-image
Avatar
i tried reading the docs, but i couldn't put my hand on "twitter image" page, it seem to be solely for images, I still don't know exactly how to setup twitter metadata in next? like what about title, description, creator....etc
Avatar
try creating export const metadata: Metadata = { ... }
and then use the intellisense
{
twitter: ...
}
Avatar
@alfonsus try creating `export const metadata: Metadata = { ... }`
Avatar
oh, so it is created using the same metadata object
ok i see i see
Avatar
yee