#!/usr/bin/env ruby # This script will generate .json data file usesd to create pages # in hugo require 'date' require 'yaml' data = Dir["assets/mirror/userfriendly/*.gif"].map do |asset| name = asset.scan(/\d+/).first date = Date.parse(name) { date: date.to_s, name: name }.transform_keys(&:to_s) end File.open("assets/mirror/userfriendly/data.yaml", "w") do |f| f.write(data.to_yaml) end