webpackage.scss -> postman.scss

This commit is contained in:
0x1eef 2023-07-11 20:14:58 -03:00
parent f5472a3b6c
commit bd000760ea
3 changed files with 17 additions and 12 deletions

22
Rules
View file

@ -33,15 +33,6 @@ def require_rules(rules, locals = {}, target = binding)
)
end
##
# Require rules
require_rules "rules/assets"
require_rules "rules/pages/surah/redirect"
require_rules "rules/pages/surah/stream", {locales:, i18n:, slugs:}
require_rules "rules/pages/surah/index", {locales:, i18n:}
require_rules "rules/pages/surah/random", {locales:, i18n:, slugs:}
require_rules "rules/pages/surah/id_redirect", {locales:, i18n:, slugs:}
##
# Inline CSS / JSON rules
compile "/i18n.json" do
@ -59,10 +50,10 @@ compile "/slugs.json" do
write(nil)
end
compile "/css/webpackage.scss" do
compile "/css/postman.scss" do
filter :sass, syntax: :scss, style: :compact
filter :rainpress
write(nil)
write("/css/postman.css")
end
##
@ -73,6 +64,15 @@ compile "/sitemap.xml.erb" do
write("/sitemap.xml")
end
##
# Require rules
require_rules "rules/assets"
require_rules "rules/pages/surah/redirect"
require_rules "rules/pages/surah/stream", {locales:, i18n:, slugs:}
require_rules "rules/pages/surah/index", {locales:, i18n:}
require_rules "rules/pages/surah/random", {locales:, i18n:, slugs:}
require_rules "rules/pages/surah/id_redirect", {locales:, i18n:, slugs:}
##
# Defaults
compile("/**/*") { write(nil) }

View file

@ -11,8 +11,13 @@ module Helper
def inline_css(path)
class_name = File.basename(path, File.extname(path))
"<style class='css #{class_name}'>" \
"#{items[path].compiled_content}" \
"#{File.binread(File.join(build_dir, 'css', 'postman.css'))}" \
"</style>"
end
def build_dir
nanoc = Ryo.from YAML.load_file(File.join(Dir.getwd, "nanoc.yaml"))
nanoc.output_dir
end
end
use_helper Helper