Skip to content

How can I set preview image for a static page in docusaurus? #5866

Answered by Josh-Cena
pranay01 asked this question in Q&A
Discussion options

You must be logged in to vote

You can use the <Head> component: https://docusaurus.io/docs/next/docusaurus-core#head

E.g.:

import React from 'react';
import Head from '@docusaurus/Head';

export default function page() {
  return (
    <main>
      <Head>
        <meta property="og:image" content="image.png" />
      </Head>
      {/* ... */}
    </main>
  );
}

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
4 replies
@slorber
Comment options

@vnugent
Comment options

@Josh-Cena
Comment options

@vanshika-srivastava
Comment options

Answer selected by Josh-Cena
Comment options

You must be logged in to vote
5 replies
@slorber
Comment options

@jcstein
Comment options

@jcstein
Comment options

@slorber
Comment options

@jcstein
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants