{{socialMetaTags}} helper

Helper for creating Open Graph and Twitter Cards meta tags. Place it in the <head> section. The helper outputs the tags you enable in Site Settings and fills them with the title, description and image of the current page.

Syntax:

{{socialMetaTags}}

Example output:

<meta property="og:title" content="Post title" />
<meta property="og:image" content="https://example.com/media/posts/1/img.jpg"/>
<meta property="og:site_name" content="Site name" />
<meta property="og:description" content="Lorem ipsum dolor" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@username" />
<meta name="twitter:title" content="Post title" />
<meta name="twitter:description" content="Lorem ipsum dolor" />
<meta name="twitter:image" content="https://example.com/media/posts/1/img.jpg" />

Create your first website with Publii

Join thousands of creators who chose independence. Create content locally and publish lightning-fast, secure websites on your own terms.

Download Publii

Free and open source. Windows, macOS and Linux.

Read the getting started guide