Class: Jekyll::StaticFile

Inherits:
Object
  • Object
show all
Defined in:
lib/polyglot.rb

Overview

Alteration to Jekyll StaticFile provides aliased methods to direct write to skip files excluded from localization

Instance Method Summary collapse

Instance Method Details

#exclude_from_localization?Boolean

Returns:

  • (Boolean)


165
166
167
168
169
170
171
# File 'lib/polyglot.rb', line 165

def exclude_from_localization?
  return false if @site.active_lang == @site.default_lang
  @site.exclude_from_localization.each do |e|
    return true if relative_path[1..-1].start_with?(e)
  end
  false
end

#write(dest) ⇒ Object



160
161
162
163
# File 'lib/polyglot.rb', line 160

def write(dest)
  return false if exclude_from_localization?
  write_orig(dest)
end

#write_origObject



159
# File 'lib/polyglot.rb', line 159

alias_method :write_orig, :write