class Jekyll::Locale::Document

Attributes

type[R]

Public Class Methods

new(canon, locale) click to toggle source
# File lib/jekyll/locale/document.rb, line 8
def initialize(canon, locale)
  setup(canon, locale)
  @collection = canon.collection
  @extname = File.extname(relative_path)
  @has_yaml_header = nil
  @type = @collection.label.to_sym
  read

  special_dir = draft? ? "_drafts" : @collection.relative_directory
  categories_from_path(special_dir)

  configure_data
end

Public Instance Methods

cleaned_relative_path() click to toggle source
# File lib/jekyll/locale/document.rb, line 22
def cleaned_relative_path
  @cleaned_relative_path ||= begin
    rel_path = relative_path[0..-extname.length - 1]
    rel_path.sub!(@locale_page_dir, "")
    rel_path.sub!(collection.relative_directory, "")
    rel_path.gsub!(%r!\.*\z!, "")
    rel_path
  end
end
url_template() click to toggle source
Calls superclass method
# File lib/jekyll/locale/document.rb, line 32
def url_template
  @url_template ||= File.join("", locale.id, super)
end