|
- require 'yaml'
-
- $picture_files = (Dir.glob(File.join("source/content", "*.jpg")) +
- Dir.glob(File.join("source/content", "*.png"))).sort.reverse
-
- def picture_info_hashes
- $picture_files.map {|path|
- base_filename = path.gsub(/\.[^.]+$/, "")
- info = {"description" => "Some drawing",
- "tags" => ["pencil", "scan", "mdscan"]}
- begin
- info = YAML.load(File.read(base_filename + ".yaml"))
- rescue Errno::ENOENT
- end
- {:id => File.basename(base_filename),
- :name => File.basename(path),
- :date => info["date"],
- :description => info["description"],
- :tags => info["tags"]}
- }
- end
|