sherby-metadata

WebJar for sherby-metadata

License

License

MIT
Categories

Categories

Data
GroupId

GroupId

org.webjars.bowergithub.sherbyelements
ArtifactId

ArtifactId

sherby-metadata
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

sherby-metadata
WebJar for sherby-metadata
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/SherbyElements/sherby-metadata

Download sherby-metadata

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bowergithub.sherbyelements/sherby-metadata/ -->
<dependency>
    <groupId>org.webjars.bowergithub.sherbyelements</groupId>
    <artifactId>sherby-metadata</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bowergithub.sherbyelements/sherby-metadata/
implementation 'org.webjars.bowergithub.sherbyelements:sherby-metadata:1.0.1'
// https://jarcasting.com/artifacts/org.webjars.bowergithub.sherbyelements/sherby-metadata/
implementation ("org.webjars.bowergithub.sherbyelements:sherby-metadata:1.0.1")
'org.webjars.bowergithub.sherbyelements:sherby-metadata:jar:1.0.1'
<dependency org="org.webjars.bowergithub.sherbyelements" name="sherby-metadata" rev="1.0.1">
  <artifact name="sherby-metadata" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bowergithub.sherbyelements', module='sherby-metadata', version='1.0.1')
)
libraryDependencies += "org.webjars.bowergithub.sherbyelements" % "sherby-metadata" % "1.0.1"
[org.webjars.bowergithub.sherbyelements/sherby-metadata "1.0.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bowergithub.polymer : polymer jar [2.0.0,3)

Project Modules

There are no modules declared in this project.

<sherby-metadata>

npm GitHub webcomponents.org MIT License Number of downloads BundlePhobia Travis CI Codecov Codacy

sherby-metadata is a LitElement used to manage meta tags data for Search Engine Optimization (SEO). It will add, update and remove <meta> elements to the <head> section based on the JSON object passed to it.

Installation

npm install @sherby/sherby-metadata

Use

To use this element, import it in your shell component and add a sherby-metadata element in your component template.

<sherby-metadata .data="${data}"></sherby-metadata>

<!-- Or alternatively if you want to dispatch events: -->
<sherby-metadata></sherby-metadata>

To update the meta tags on your page, you can update the data property in your shell component or you can dispatch a sherby-metadata event:

// By updating the data property
this.data = {
  description: 'This is the page description',
  keywords: 'these,are,keywords',
  title: 'This is the page title',
};

// By dispatching a custom event
this.dispatchEvent(
  new CustomEvent('sherby-metadata', {
    detail: {
      description: 'This is the page description',
      keywords: 'these,are,keywords',
      title: 'This is the page title',
    },
  }),
);

This component support also the OpenGraph tags:

this.data = {
  'og:description': 'This is the page description',
  'og:keywords': 'these,are,keywords',
  'og:title': 'This is the page title',
};

Thanks

Special thanks to CaptainCodeman for his app-metadata component that inspired me for this component.

Publish

Increment the version defined in the package.json file and run the command below to publish the module in the registry:

# Dry run
npm publish --dry-run

# For real (are you really sure?)
npm publish

License

The MIT License (MIT)

org.webjars.bowergithub.sherbyelements

SherbyElements

A collection of Web Components, made in Sherbrooke (Quebec), Canada

Versions

Version
1.0.1