1.1.0 • Published 1 year ago

metas v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
1 year ago

Metas

Generate meta tags for HTML page

Install

npm install metas

Usage

import metas from 'metas';

// get as HTML
metas({
    title: "PAGE TITLE"
})
/* ->
<meta charset="utf-8"/>
<meta itemprop="name" content="PAGE TITLE"/>
<meta name="twitter:title" content="PAGE TITLE"/>
<meta name="og:title" content="PAGE TITLE"/>
*/

// get as Array
metas({
    title: "PAGE TITLE"
}, true)
/* ->
[{
    charset: 'utf-8'
}, {
    itemprop: 'name',
    content: 'TITLE'
}, {
    name: 'twitter:title',
    content: 'TITLE'
}, {
    name: 'og:title',
    content: 'TITLE'
}]
*/

Options

metas( options = {}, returnArray = false );
  • Page infos
    • options.title Page title
    • options.description Page description
    • options.image Preview image
    • options.video Media (Audio/Video) source url
    • options.url URL for the page
    • options.charset charset for the page
    • options.locale Locale name (eg. en_US)
    • options.type Page type (eg. website, article...)
  • Site infos
    • options.siteName Site name
  • For Twitter
    • options.twitter.card Twitter card type (eg. summary, player)
    • options.twitter.siteCreator Username of the site creator/administrator on Twitter
    • options.twitter.author Username of the author for this page on Twitter
  • For Facebook
    • options.facebook.adminsId User ID(s) of the site creator/administrator on Facebook
    • options.facebook.appId Facebook App ID
1.1.0

1 year ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.2

8 years ago

0.0.1

8 years ago