Class: Jekyll::SeoTag::ImageDrop
- Inherits:
-
Drops::Drop
- Object
- Drops::Drop
- Jekyll::SeoTag::ImageDrop
- Includes:
- UrlHelper
- Defined in:
- lib/starter_web/_plugins/seo/j1-seo-tags.rb
Overview
A drop representing the page image The image path will be pulled from:
1. The `image` key if it's a string
2. The `image.path` key if it's a hash
3. The `image.facebook` key
4. The `image.twitter` key
Instance Method Summary collapse
-
#initialize(page: nil, context: nil) ⇒ ImageDrop
constructor
Initialize a new ImageDrop: page - The page hash (e.g., Page#to_liquid) context - the Liquid::Context.
-
#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
666 667 668 669 670 671 672 |
# File 'lib/starter_web/_plugins/seo/j1-seo-tags.rb', line 666 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
678 679 680 |
# File 'lib/starter_web/_plugins/seo/j1-seo-tags.rb', line 678 def path @path ||= filters.uri_escape(absolute_url) if absolute_url end |