1.0.12 • Published 11 months ago

@daveyplate/next-open-graph v1.0.12

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

@daveyplate/next-open-graph

Description

This package provides a simple way to add Open Graph meta tags to your Next.js application.

Installation

npm install @daveyplate/next-open-graph

Usage

import { OpenGraph } from '@daveyplate/next-open-graph'

export default function MyPage() {
  return (
    <>
        <OpenGraph
            title="My Page"
            description="This is my page"
            image="https://example.com/image.jpg"
            ogType="article"
            twitterCard="summary"
            url="https://example.com/my-page"
            siteName="My Awesome Site"
        />
    </>
  )
}

Props

title (optional)

  • Type: string
  • Description: The title of the page. If provided, it will be appended with the site name.

description (optional)

  • Type: string
  • Description: The description of the page.

image (optional)

  • Type: string
  • Description: The URL of the image to be used in the Open Graph and Twitter meta tags. If not provided, a default image URL will be used.

images (optional)

  • Type: string[]
  • Description: An array of image URLs to be used in the Open Graph meta tags.

ogType (optional)

  • Type: string
  • Default: 'website'
  • Description: The type of the Open Graph object (e.g., article, website).

twitterCard (optional)

  • Type: string
  • Default: 'summary'
  • Description: The type of the Twitter card (e.g., summary, summary_large_image).

url (optional)

  • Type: string
  • Description: The URL of the page. If not provided, the current URL will be used.

siteName (optional)

  • Type: string
  • Default: process.env.NEXT_PUBLIC_SITE_NAME
  • Description: The name of the site.
1.0.2

11 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.11

11 months ago

1.0.10

11 months ago

1.0.12

11 months ago

1.0.1

1 year ago

1.0.0

1 year ago