class Octopress::Multilingual::PagePayloadHook
Public Instance Methods
deep_merge_payload(page_payload, hook_payload)
click to toggle source
Override deep_merge to prevent categories and tags from being combined when they shouldn’t
# File lib/octopress-multilingual/hooks.rb, line 48 def deep_merge_payload(page_payload, hook_payload) %w{site page}.each do |key| hook_payload[key] = page_payload[key].merge(hook_payload[key] || {}) end hook_payload end
merge_payload(payload, item)
click to toggle source
Swap out post arrays with posts of the approrpiate language
# File lib/octopress-multilingual/hooks.rb, line 40 def merge_payload(payload, item) if item.lang Octopress::Multilingual.page_payload(item.lang) end end
post_init(item)
click to toggle source
# File lib/octopress-multilingual/hooks.rb, line 32 def post_init(item) if item.lang == 'default' item.data['lang'] = item.site.config['lang'] end end