Class: Jekyll::LanguagePage

Inherits:
Page
  • Object
show all
Includes:
LanguageProperties
Defined in:
lib/jekyll/language_page.rb

Instance Method Summary collapse

Methods included from LanguageProperties

#language, #languages, #subset

Instance Method Details

#templateObject



11
12
13
14
# File 'lib/jekyll/language_page.rb', line 11

def template
  return "/:language" + template_orig if !language.nil?
  template_orig
end

#template_origObject



8
# File 'lib/jekyll/language_page.rb', line 8

alias_method :template_orig, :template

#url_placeholdersObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/jekyll/language_page.rb', line 16

def url_placeholders
  result = url_placeholders_orig.merge!({
    language: language,
    subset: subset
  })

  if !language.nil? && !subset.nil?
    language_data = @site.languageData || LanguagePlugin::LanguageData.new(@site)

    data = language_data.get(subset, language)

    if !data.nil?
      filtered = data.reject{ |k, v| v.is_a?(Enumerable) }
      result.merge!(Hash[filtered.map{ |k, v| ["t.#{k}", v] }])
    end
  end

  result
end

#url_placeholders_origObject



9
# File 'lib/jekyll/language_page.rb', line 9

alias_method :url_placeholders_orig, :url_placeholders