diff options
Diffstat (limited to 'bin/uf_gen.rb')
-rwxr-xr-x | bin/uf_gen.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/uf_gen.rb b/bin/uf_gen.rb new file mode 100755 index 0000000..78c9ff7 --- /dev/null +++ b/bin/uf_gen.rb @@ -0,0 +1,22 @@ +#!/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 |