Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erdembircan/meta-cards
A library to add open graph meta cards to HTML documents.
https://github.com/erdembircan/meta-cards
cards graph javascript meta npm open
Last synced: 3 days ago
JSON representation
A library to add open graph meta cards to HTML documents.
- Host: GitHub
- URL: https://github.com/erdembircan/meta-cards
- Owner: erdembircan
- License: mit
- Created: 2017-11-30T21:42:32.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-06-28T15:42:44.000Z (over 2 years ago)
- Last Synced: 2024-09-18T17:49:11.432Z (about 2 months ago)
- Topics: cards, graph, javascript, meta, npm, open
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/meta-cards
- Size: 27.3 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# meta-cards [![Build Status](https://travis-ci.org/erdembircan/meta-cards.svg?branch=master)](https://travis-ci.org/erdembircan/meta-cards)
---
## A library to add open graph meta cards to HTML documents.
## Installation
`npm install meta-cards --save`
---
## Usage
```
const metaCards = require('meta-cards');const cardOptions = {
url: 'www.jestrocks.com',
description: 'mocking DOM',
image: 'http://i0.kym-cdn.com/photos/images/original/000/234/739/fa5.jpg',
title: 'test title',
'twitter:card' : 'summary',
'twitter:site' : '@site',
'twitter:creator' : '@admin',
'custom:tag': 'very custom'
};metaCards.addCards(cardOptions, true, true)
```---
# API
## addCards(options,[autofill] ,[override])
add open graph meta cards to HTML documents
#### options
Type: `object`
options object containing meta properties.
sub properties are documented with jsdoc for IDE auto completion.#### [autofill=false]
Type: `boolean`
autofill not included tags with 'no' prefix#### [override=false]
Type: `boolean`
override tags with custom properties---
## License
Copyright © 2017, Erdem Bircan. Released under the MIT License.