Class: Jekyll::SeoTag::ImageDrop
- Inherits:
-
Drops::Drop
- Object
- Drops::Drop
- Jekyll::SeoTag::ImageDrop
- Includes:
- UrlHelper
- Defined in:
- lib/jekyll-seo-tag/image_drop.rb
Overview
A drop representing the page image The image path will be pulled from:
-
The ‘image` key if it’s a string
-
The ‘image.path` key if it’s a hash
-
The ‘image.facebook` key
-
The ‘image.twitter` key
Instance Method Summary collapse
-
#initialize(page: nil, context: nil) ⇒ ImageDrop
constructor
Initialize a new ImageDrop.
-
#path ⇒ Object
(also: #to_s)
Called path for backwards compatability, this is really the escaped, absolute URL representing the page’s image Returns nil if no image path can be determined.
Constructor Details
#initialize(page: nil, context: nil) ⇒ ImageDrop
Initialize a new ImageDrop
page - The page hash (e.g., Page#to_liquid) context - the Liquid::Context
19 20 21 22 23 24 25 |
# File 'lib/jekyll-seo-tag/image_drop.rb', line 19 def initialize(page: nil, context: nil) raise ArgumentError unless page && context @mutations = {} @page = page @context = context end |
Instance Method Details
#path ⇒ Object Also known as: to_s
Called path for backwards compatability, this is really the escaped, absolute URL representing the page’s image Returns nil if no image path can be determined
30 31 32 |
# File 'lib/jekyll-seo-tag/image_drop.rb', line 30 def path @path ||= filters.uri_escape(absolute_url) if absolute_url end |