Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/egg-/ogp-meta
Generate open graph meta tags.
https://github.com/egg-/ogp-meta
generator meta ogp-meta opengraph opengraph-tags
Last synced: about 2 months ago
JSON representation
Generate open graph meta tags.
- Host: GitHub
- URL: https://github.com/egg-/ogp-meta
- Owner: egg-
- License: mit
- Created: 2015-07-13T08:28:39.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-20T07:46:11.000Z (over 8 years ago)
- Last Synced: 2024-11-19T19:24:14.963Z (about 2 months ago)
- Topics: generator, meta, ogp-meta, opengraph, opengraph-tags
- Language: JavaScript
- Size: 10.7 KB
- Stars: 8
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ogp-meta
[![version](https://img.shields.io/npm/v/ogp-meta.svg) ![download](https://img.shields.io/npm/dm/ogp-meta.svg)](https://www.npmjs.com/package/ogp-meta)
Generate open graph meta tags.
[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
## Usage
```javascript
var OpenGraph = require('../')var ogp = new OpenGraph()
ogp.title('title')
ogp.type('website')
ogp.description('description')
ogp.site_name('site_name')
ogp.url('http://ogp-meta.npm')
ogp.image('http://image url')
// reset
ogp.image(null)
ogp.image({
url: 'http://image url',
width: 400,
height: 400
})
ogp.video('http://video url')
// reset
ogp.video(null)
ogp.video({
url: 'http://video url',
width: 1024,
height: 720
})
ogp.app({
url: 'example://app',
app_store_id: 'app_store_id',
app_name: 'app_name'
}, 'ios')
ogp.app({
url: 'example://app',
package: 'com.ogp-meta.app',
app_name: 'app_name'
}, 'android')console.log(ogp.toHTML())
```## LICENSE
ogp-meta is licensed under the MIT license.