Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

fix: check if static_file_r_path is set #102

Merged
merged 4 commits into from
Dec 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions lib/jekyll-multiple-languages-plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,16 @@ module Jekyll
static_files.delete_if do |static_file|

# Remove "/" from beginning of static file relative path
static_file_r_path = static_file.instance_variable_get(:@relative_path).dup
static_file_r_path[0] = ''

exclude_paths.any? do |exclude_path|
Pathname.new(static_file_r_path).descend do |static_file_path|
break(true) if (Pathname.new(exclude_path) <=> static_file_path) == 0
if static_file.instance_variable_get(:@relative_path) != nil
static_file_r_path = static_file.instance_variable_get(:@relative_path).dup
if static_file_r_path
static_file_r_path[0] = ''

exclude_paths.any? do |exclude_path|
Pathname.new(static_file_r_path).descend do |static_file_path|
break(true) if (Pathname.new(exclude_path) <=> static_file_path) == 0
end
end
end
end
end
Expand Down