@gudhub/meta-tag-component

1.0.0 • Public • Published

Meta tag web component

Basic example

<meta-tag  type="description"></meta-tag>

Possible attributes

  • type - type of meta tag. Also, this will be namespace for value finding in application. type can be "title" or "description".

  • data-chapter - application for value finding. 'pages' by default.

  • og - if true, will make open graph meta tag. For example, if you will pass type="description" and og="true", it will generate a meta tag with name 'og:description'. In case if you will pass type="title" and og="true", will generate meta tag with two attributes
<meta property="og:site_name" content="[title_of_page]">

  • twitter - if true, will make twitter card meta tag. For example, if you will pass type="description" and twitter="true", it will generate a meta tag with name 'twitter:description'.

  • data-twitter-name - in this attribute you need set @username of website in Twitter. You need to use this attribute with atributes - "twitter" and " type='title' ". Example:
<meta-tag  twitter  type="title"  data-twitter-name="@username"></meta-tag>

It will generate this meta tags:

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="[data_twitter_name]">

Complex usage

<meta-tag  og  type="title"></meta-tag>
<meta-tag  twitter  type="title"  data-twitter-name="@username"></meta-tag>
<meta-tag  type="description"></meta-tag>
<meta-tag  og  type="description"></meta-tag>
<meta-tag  twitter  type="description"></meta-tag>

Readme

Keywords

none

Package Sidebar

Install

npm i @gudhub/meta-tag-component

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

6.21 kB

Total Files

3

Last publish

Collaborators

  • gudhub