summaryrefslogtreecommitdiff
path: root/bin/uf_gen.rb
blob: 78c9ff770fc56c4ceea4d0b26d9eb3a3b1d67a04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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