al-quran.reflectslight.io/lib/helper.rb

19 lines
462 B
Ruby
Raw Normal View History

2023-03-11 13:31:37 +01:00
# frozen_string_literal: true
module Helper
def inline_json(path)
2023-03-11 13:31:37 +01:00
class_name = File.basename(path, File.extname(path))
"<script class='json #{class_name}' type='application/json'>" \
"#{items[path].compiled_content}" \
"</script>"
end
2023-03-11 14:45:12 +01:00
def inline_css(path)
class_name = File.basename(path, File.extname(path))
"<style class='css #{class_name}'>" \
2023-03-11 14:45:12 +01:00
"#{items[path].compiled_content}" \
"</style>"
end
end
use_helper Helper