Generates Open Graph meta tags for the HTML head section.
Since various social media platforms parse these tags differently, every tag uses both name and property attributes for maximum compatibility.
name
property
import { openGraph } from '@raven-js/beak/seo';const tags = openGraph({ title: 'My Page', description: 'This is my page description', domain: 'example.com', path: '/my-page', imageUrl: '/my-image.jpg', type: 'article'});// Output:// <meta name="og:type" property="og:type" content="article">// <meta name="og:title" property="og:title" content="My Page" />// <meta name="og:description" property="og:description" content="This is my page description" />// <meta name="og:url" property="og:url" content="https://example.com/my-page" />// <meta name="og:image" property="og:image" content="https://example.com/my-image.jpg" /> Copy
import { openGraph } from '@raven-js/beak/seo';const tags = openGraph({ title: 'My Page', description: 'This is my page description', domain: 'example.com', path: '/my-page', imageUrl: '/my-image.jpg', type: 'article'});// Output:// <meta name="og:type" property="og:type" content="article">// <meta name="og:title" property="og:title" content="My Page" />// <meta name="og:description" property="og:description" content="This is my page description" />// <meta name="og:url" property="og:url" content="https://example.com/my-page" />// <meta name="og:image" property="og:image" content="https://example.com/my-image.jpg" />
Configuration object for Open Graph tags
The generated Open Graph meta tags as an HTML string
Generates Open Graph meta tags for the HTML head section.
Since various social media platforms parse these tags differently, every tag uses both
name
andproperty
attributes for maximum compatibility.Example