#!/usr/bin/env ruby # frozen_string_literal: true ## # Rules for a redirect from //random/ to a random surah # (eg /en/random/ -> /en/al-kahf/) locales.each do |locale| compile "/html/random.html.erb", rep: "random/#{locale}" do context = Ryo.from({locale:}) filter(:erb, locals: {context:}) filter(:tidy) write("/#{locale}/random/index.html") end end compile "/js/main/random.ts" do filter(:webpack, depend_on: ["/js/lib/"]) write("/js/main/random.js") end