From 7ed442dfa3b26483ff6cd1eeb871b40b6be97f52 Mon Sep 17 00:00:00 2001 From: User Mms Date: Tue, 29 Oct 2024 15:30:06 +0100 Subject: feat: UF archive --- bin/uf_gen.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 bin/uf_gen.rb (limited to 'bin') 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 -- cgit v1.2.3