class Jekyll::Post
Public Instance Methods
crosspost_languages()
click to toggle source
# File lib/octopress-multilingual/jekyll.rb, line 116 def crosspost_languages data['lang_crosspost'] end
lang()
click to toggle source
# File lib/octopress-multilingual/jekyll.rb, line 110 def lang if data['lang'] data['lang'].downcase end end
next()
click to toggle source
# File lib/octopress-multilingual/jekyll.rb, line 126 def next language = lang || site.config['lang'] posts = Octopress::Multilingual.posts_by_language(language) pos = posts.index {|post| post.equal?(self) } if pos && pos < posts.length - 1 posts[pos + 1] else nil end end
previous()
click to toggle source
# File lib/octopress-multilingual/jekyll.rb, line 138 def previous language = lang || site.config['lang'] posts = Octopress::Multilingual.posts_by_language(language) pos = posts.index {|post| post.equal?(self) } if pos && pos > 0 posts[pos - 1] else nil end end
template()
click to toggle source
# File lib/octopress-multilingual/jekyll.rb, line 88 def template template = template_orig if self.site.config['lang'] if [:pretty, :none, :date, :ordinal].include? site.permalink_style template = File.join('/:lang', template) end end template end
Also aliased as: template_orig
translated()
click to toggle source
# File lib/octopress-multilingual/jekyll.rb, line 100 def translated data['translation_id'] && !translations.empty? end
translations()
click to toggle source
# File lib/octopress-multilingual/jekyll.rb, line 104 def translations if data['translation_id'] @translations ||= Octopress::Multilingual.translated_posts[data['translation_id']].reject {|p| p == self} end end
url_placeholders()
click to toggle source
# File lib/octopress-multilingual/jekyll.rb, line 120 def url_placeholders url_placeholders_orig.merge({ :lang => lang }) end
Also aliased as: url_placeholders_orig