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:
-
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
550 551 552 553 554 555 556 |
# File 'lib/starter_web/_plugins/seo/j1-seo-tags.rb', line 550 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
561 562 563 |
# File 'lib/starter_web/_plugins/seo/j1-seo-tags.rb', line 561 def path @path ||= filters.uri_escape(absolute_url) if absolute_url end |