From f06432b2ae30219eec9865b1fa11efbe9ec1fb42 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Thu, 2 May 2024 11:29:46 -0300 Subject: [PATCH] Update nanoc/rules/ --- Rules | 4 ++++ nanoc/rules/assets.rules | 12 +++--------- nanoc/rules/index.rules | 4 +--- nanoc/rules/random.rules | 6 ++---- nanoc/rules/redirect.rules | 6 ++---- nanoc/rules/stream.rules | 5 ++--- 6 files changed, 14 insertions(+), 23 deletions(-) diff --git a/Rules b/Rules index 37ec56b..8ed8d52 100644 --- a/Rules +++ b/Rules @@ -53,6 +53,10 @@ compile "/robots.txt" do write("/robots.txt") end +## +# /json/durations/*/*.json +passthrough "/json/durations/*/*.json" + ## # require rules require_rules "nanoc/rules/assets" diff --git a/nanoc/rules/assets.rules b/nanoc/rules/assets.rules index a85738e..c7b944d 100644 --- a/nanoc/rules/assets.rules +++ b/nanoc/rules/assets.rules @@ -1,11 +1,9 @@ #!/usr/bin/env ruby # frozen_string_literal: true +# Contains rules for images, fonts, etc ## -# Contains rules that are related to assets (eg images, fonts, etc) - -## -# Fonts +# fonts compile "/fonts/*" do write(item.identifier.to_s) filter :gzip @@ -13,7 +11,7 @@ compile "/fonts/*" do end ## -# Images +# images compile "/images/*.svg" do write(item.identifier.to_s) filter :gzip @@ -31,7 +29,3 @@ end compile "/favicon.ico" do write(item.identifier.to_s) end - -## -# JSON -passthrough "/json/durations/*/*.json" diff --git a/nanoc/rules/index.rules b/nanoc/rules/index.rules index 86ce34c..eb05e6e 100644 --- a/nanoc/rules/index.rules +++ b/nanoc/rules/index.rules @@ -1,8 +1,6 @@ #!/usr/bin/env ruby # frozen_string_literal: true - -## -# Rules for the surah index available at //. +# Contains rules for the surah index available at // locales.each do |locale| compile "/html/index.html.erb", rep: "/#{locale}/surah/index" do diff --git a/nanoc/rules/random.rules b/nanoc/rules/random.rules index 58606d3..fe23b4c 100644 --- a/nanoc/rules/random.rules +++ b/nanoc/rules/random.rules @@ -1,9 +1,7 @@ #!/usr/bin/env ruby # frozen_string_literal: true - -## -# Rules for a redirect from //random/ to a random surah -# (eg /en/random/ -> /en/al-kahf/) +# Contains 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 diff --git a/nanoc/rules/redirect.rules b/nanoc/rules/redirect.rules index f3509db..9398506 100644 --- a/nanoc/rules/redirect.rules +++ b/nanoc/rules/redirect.rules @@ -1,9 +1,7 @@ #!/usr/bin/env ruby # frozen_string_literal: true - -## -# Rules for a redirect from the root path to the surah index -# for a given locale (eg / -> /en/). +# Contains rules for a redirect from the root path +# to the surah index for a given locale (eg / -> /en/) compile "/html/redirect.html.erb" do filter(:tidy) diff --git a/nanoc/rules/stream.rules b/nanoc/rules/stream.rules index 770a8e2..61a991a 100644 --- a/nanoc/rules/stream.rules +++ b/nanoc/rules/stream.rules @@ -1,8 +1,7 @@ #!/usr/bin/env ruby # frozen_string_literal: true - -## -# Rules for the surah stream available at ///. +# Contains rules for the the surah stream available +# at ///, /// compile "/json/*/*/surah.json" do write(item.identifier.to_s)