README.md in jekyll-linkpreview-0.6.0 vs README.md in jekyll-linkpreview-0.7.0
- old
+ new
@@ -1,8 +1,9 @@
# Jekyll::Linkpreview
-[![Build Status](https://travis-ci.com/ysk24ok/jekyll-linkpreview.svg?branch=master)](https://travis-ci.com/ysk24ok/jekyll-linkpreview)
+[![Test](https://github.com/ysk24ok/jekyll-linkpreview/actions/workflows/test.yaml/badge.svg)](https://github.com/ysk24ok/jekyll-linkpreview/actions/workflows/test.yaml)
+[![Release](https://github.com/ysk24ok/jekyll-linkpreview/actions/workflows/release.yaml/badge.svg)](https://github.com/ysk24ok/jekyll-linkpreview/actions/workflows/release.yaml)
Jekyll plugin to generate link preview by `{% linkpreview %}` tag. The plugin fetches [Open Graph protocol](http://ogp.me/) metadata of the designated page to generate preview. The og properties are saved as JSON for caching and it is used when rebuilding the site.
You can pass url directly to the tag,
@@ -47,32 +48,56 @@
You can override the default templates used for generating previews, both in case Open Graph protocol metadata exists or does not exist for a given page.
### Template for pages where Open Graph protocol metadata exists
- 1. Place `linkpreview.html` file inside `_includes/` folder of your Jekyll site (`_includes/linkpreview.html`)
+1. Place `linkpreview.html` file inside `_includes/` folder of your Jekyll site (`_includes/linkpreview.html`)
* The folder is the same one you would store files for use with `{% include fragment.html %}` tag.
Therefore, it *must* be under the [site's source](https://jekyllrb.com/docs/configuration/options/).
- 2. Use built-in variables to extract data which you would like to render. Available variables are:
- * **link_url** i.e. `{{ link_url }}`
- * **link_title** i.e. `{{ link_title }}`
- * **link_type** i.e. `{{ link_type }}`
- * **link_image** i.e. `{{ link_image }}`
- * **link_description** i.e. `{{ link_description }}`
- * **link_domain** i.e. `{{ link_domain }}`
+2. Use built-in variables to extract data which you would like to render. Available variables are:
+ * basic metadata
+ * `{{ title }}` for `og:title`
+ * `{{ type }}` for `og:type`
+ * `{{ image }}` for `og:image`
+ * `{{ url }}` for `og:url`
+ * optional metadata
+ * `{{ description }}` for `og:description`
+ * `{{ determiner }}` for `og:determiner`
+ * `{{ locale }}` for `og:locale`
+ * `{{ locale_alternate }}` for `og:locale:alternate`
+ * `{{ site_name }}` for `og:site_name`
+ * image
+ * `{{ image }}` for `og:image`
+ * `{{ image_secure_url }}` for `og:image:secure_url`
+ * `{{ image_type }}` for `og:image:type`
+ * `{{ image_width }}` for `og:image:width`
+ * `{{ image_height }}` for `og:image:height`
+ * `{{ image_alt }}` for `og:image:alt`
+ * video
+ * `{{ video }}` for `og:video`
+ * `{{ video_secure_url }}` for `og:video:secure_url`
+ * `{{ video_type }}` for `og:video:type`
+ * `{{ video_width }}` for `og:video:width`
+ * `{{ video_height }}` for `og:video:height`
+ * audio
+ * `{{ audio }}` for `og:audio`
+ * `{{ audio_secure_url }}` for `og:audio:secure_url`
+ * `{{ audio_type }}` for `og:audio:type`
+ * non og metadata
+ * `{{ domain }}`
### Template for pages where Open Graph protocol metadata does not exist
1. Place `linkpreview_nog.html` file inside `_includes/` folder of your Jekyll site (`_includes/linkpreview_nog.html`)
- * The folder is the same one you would store files for use with `{% include fragment.html %}` tag.
- Therefore, it *must* be under the [site's source](https://jekyllrb.com/docs/configuration/options/).
+ * The folder is the same one you would store files for use with `{% include fragment.html %}` tag.
+ Therefore, it *must* be under the [site's source](https://jekyllrb.com/docs/configuration/options/).
- 2. Use built-in variables to extract data which you would like to render. Available variables are:
- * **link_url** i.e. `{{ link_url }}`
- * **link_title** i.e. `{{ link_title }}`
- * **link_description** i.e. `{{ link_description }}`
- * **link_domain** i.e. `{{ link_domain }}`
+2. Use built-in variables to extract data which you would like to render. Available variables are:
+ * `{{ title }}`
+ * `{{ url }}`
+ * `{{ description }}`
+ * `{{ domain }}`
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.