class Jekyll::SeoTag::SooprDrop

A drop representing soopr and soopr's publish token The publish key will be pulled from:

  1. The `soopr` key if it's a string

  2. The `soopr.publish_token` if it's a hash

  3. The `soopr.publish_key` if it's a hash

Attributes

page[R]
site[R]

Public Class Methods

new(page: nil, site: nil) click to toggle source

Initialize a new SooprDrop

page - The page hash (e.g., Page#to_liquid) context - the Liquid::Context

# File lib/jekyll-seo-tag/soopr_drop.rb, line 17
def initialize(page: nil, site: nil)
  raise ArgumentError unless page && site

  @mutations = {}
  @page = page
  @site = site
end

Public Instance Methods

publish_token() click to toggle source
# File lib/jekyll-seo-tag/soopr_drop.rb, line 25
def publish_token
  soopr_hash["publish_token"] || soopr_hash["publish_key"] 
end
Also aliased as: to_s
to_s()
Alias for: publish_token

Private Instance Methods

fallback_data()

Since author_hash is aliased to fallback_data, any values in the hash will be exposed via the drop, allowing support for arbitrary metadata

Alias for: soopr_hash
soopr_hash() click to toggle source
# File lib/jekyll-seo-tag/soopr_drop.rb, line 36
def soopr_hash
  @soopr_hash ||= begin
    return {} unless site["soopr"].is_a?(Hash)

    soopr_hash = site["soopr"]
    soopr_hash.is_a?(Hash) ? soopr_hash : {}
  end
end
Also aliased as: fallback_data