module Jekyll::Locale::Helper

Attributes

canon[R]
relative_path[R]

Public Instance Methods

inspect() click to toggle source
# File lib/jekyll/locale/mixins/helper.rb, line 22
def inspect
  "#<#{self.class} @canon=#{canon.inspect} @locale=#{locale.inspect}>"
end
Also aliased as: to_s
setup_hreflangs() click to toggle source
# File lib/jekyll/locale/mixins/helper.rb, line 11
def setup_hreflangs
  page_set = [canon] + canon.locale_pages
  @hreflangs = sibling_data(page_set)
  @locale_siblings = sibling_data(page_set - [self])
end
setup_hreflangs?() click to toggle source
# File lib/jekyll/locale/mixins/helper.rb, line 7
def setup_hreflangs?
  true
end
to_s()
Alias for: inspect

Private Instance Methods

configure_data() click to toggle source
# File lib/jekyll/locale/mixins/helper.rb, line 39
def configure_data
  Array(@data["categories"]).delete_if do |category|
    category == @site.locale_handler.content_dirname || category == @locale.id
  end

  @data = Jekyll::Utils.deep_merge_hashes(canon.data, @data)
  @data.default_proc = proc do |_, key|
    site.frontmatter_defaults.find(relative_path, type, key)
  end
end
configure_payload(payload) click to toggle source
# File lib/jekyll/locale/mixins/helper.rb, line 50
def configure_payload(payload)
  payload.to_h.tap do |data|
    data["path"] = self.relative_path
    data["url"]  = self.url
  end
end
setup(canon, locale) click to toggle source
# File lib/jekyll/locale/mixins/helper.rb, line 29
def setup(canon, locale)
  @locale  = locale
  @canon   = canon
  @site    = canon.site
  @extname = canon.extname
  @locale_page_dir = File.join(@site.locale_handler.content_dirname, locale.id, "")
  @relative_path   = File.join(@locale_page_dir, canon.relative_path)
  @path = @site.in_source_dir(@relative_path)
end