https://github.com/frontendmasters/gitbook-plugin-open-graph
Adds open graph and twitter share meta tags to gitbook
https://github.com/frontendmasters/gitbook-plugin-open-graph
Last synced: 4 months ago
JSON representation
Adds open graph and twitter share meta tags to gitbook
- Host: GitHub
- URL: https://github.com/frontendmasters/gitbook-plugin-open-graph
- Owner: FrontendMasters
- Created: 2018-04-09T15:11:19.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-09T16:21:56.000Z (over 7 years ago)
- Last Synced: 2025-02-27T16:03:35.632Z (10 months ago)
- Language: HTML
- Size: 1.95 KB
- Stars: 1
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gitbook-plugin-open-graph
Adds open graph and twitter sharing meta information to ``
## Installation
npm install gitbook-plugin-open-graph
## Usage
add to `book.json`
```
{
"plugins": [
"open-graph"
],
"pluginsConfig": {
"open-graph": {
"baseURL": "http://example.com"
"defaultDescription": "This is my default share description",
"defaultImage": "images/default-share.jpg"
}
}
}
```
## Open graph titles, descriptions and images
By configuring a default description and image, every page will have that image associated with it when being shared on twitter or facebook.
You can customize any page's share title, description and image in the book by using these properties in the front matter:
```markdown
---
opengraphimage: images/sharepage.jpg
opengraphtitle: This is my page-level sharing title!
description: This description will be added both to the SEO meta description as well as the share description.
opengraphdescription: If you want your open graph description to be different then your SEO description, use both!
---
```
## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D
## License
MIT