Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Opengraph support
This PR implements automatic support for opengraph and additionally twitter cards. For an overview of both standards please see:
1. Default properties
website
page image
page title
page description
page url
For opengraph metadata to be added to the page both the
og:type
andog:image
properties need to be defined.2. Custom properties
Properties can be added or custom values for defaults defined by specifying them in the page frontmatter. Example:
3. Global properties
Default properties can be configured, or additional properties can be added using a new 'metadata' config option. Example:
4. Disabling opengraph
Opengraph support can be disabled by setting the 'og:type' metadata property to
false
.Notes
The
image
should be a site absolute image path, or a url. If it's a path it's transformed into a url when the metadata is being rendered.For twitter we making use of the opengraph properties supported by twitter. For info see: https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/markup Specific twitter properties need to be defined either in the page frontmatter of in the global configuration.
Additional improvements
This PR also adds a page ìmage`property.