Browse Source

Exclude image files from navigation list

master
Stu Franks 5 months ago
parent
commit
79081ee72f
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      lib/dir_tree.rb

+ 1
- 1
lib/dir_tree.rb View File

@@ -52,7 +52,7 @@ def directory_hash(path, name=nil)
data = {:data => (name || path)}
data[:children] = children = []
Dir.foreach(path) do |entry|
next if (entry == '..' || entry == '.' || entry == '.git' || entry.include?('index') || entry.include?('.sh') || entry.include?('.swp') )
next if (entry == '..' || entry == '.' || entry == '.git' || entry.include?('index') || entry.include?('.sh') || entry.include?('.swp') || entry.include?('.png') || entry.include?('.jpg') || entry.include?('.jpeg') )
full_path = File.join(path, entry)
if File.directory?(full_path)
children << directory_hash(full_path, entry)


Loading…
Cancel
Save