Initial commit
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
commit
a48def1358
|
@ -0,0 +1,20 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2020 Harsh Shandilya
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -0,0 +1,37 @@
|
|||
# hugo-social-metadata
|
||||
|
||||
## About
|
||||
|
||||
This is a [Hugo](https://gohugo.io) theme component that automatically generates metadata complying to [The Open Graph Protocol](https://ogp.me/) as well as [Twitter Cards](https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/getting-started). This is **NOT** a standalone theme and must not be treated as such.
|
||||
|
||||
## Usage
|
||||
|
||||
1. Add the hugo-social-metadata repository as a submodule to be able to get upstream changes later `git submodule add https://github.com/msfjarvis/hugo-social-metadata.git themes/hugo-social-metadata`
|
||||
|
||||
2. Start off by configuring a few things in your `config.toml` (or equivalent file depending on whether you use YAML or JSON). These will be picked up by the theme component and used to provide metadata for the site.
|
||||
|
||||
```toml
|
||||
[params]
|
||||
description = "A description for your awesome website goes here"
|
||||
keywords = "some, keywords, that, describe, your, content"
|
||||
twitterUsername = "@your_twitter_username"
|
||||
socialImage = "path/to/the/twitter/card/image"
|
||||
```
|
||||
|
||||
3. Include the `social_metadata.html` partial in your `head.html` like so: `{{ partial "social_metadata.html" . }}`.
|
||||
|
||||
## Additional customizations
|
||||
|
||||
You can customize some of the generated metadata on a per-page basis. Setting `description`, `socialImage` or `tags` in the frontmatter will override the defaults loaded from the main config file.
|
||||
|
||||
```markdown
|
||||
+++
|
||||
description = "A nice description for this blogpost"
|
||||
socialImage = "path/to/an/image/that/describes/this/post/best"
|
||||
tags = ["this", "blog", "rocks!"]
|
||||
+++
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Check out the [LICENSE](/LICENSE) file in the root of this repository.
|
Loading…
Reference in New Issue