lib/nanoc/data_sources/filesystem.rb in nanoc-4.9.6 vs lib/nanoc/data_sources/filesystem.rb in nanoc-4.9.7

- old
+ new

@@ -334,10 +334,10 @@ if config[:identifier_type] == 'full' return Nanoc::Identifier.new(filename) end regex = - if filename =~ /(^|\/)index(\.[^\/]+)?$/ + if /(^|\/)index(\.[^\/]+)?$/.match?(filename) allow_periods_in_identifiers? ? /\/?(index)?(\.[^\/\.]+)?$/ : /\/?index(\.[^\/]+)?$/ else allow_periods_in_identifiers? ? /\.[^\/\.]+$/ : /\.[^\/]+$/ end Nanoc::Identifier.new(filename.sub(regex, ''), type: :legacy)