2023-10-08 00:16:37 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-10-07 08:21:48 +02:00
|
|
|
module Mixin::Inline
|
2024-04-30 10:51:59 +02:00
|
|
|
def inline_json(path, class_name: File.basename(path, File.extname(path)))
|
2024-05-26 07:56:50 +02:00
|
|
|
%|<script class="json #{class_name}" type="application/json">| \
|
2023-10-07 08:21:48 +02:00
|
|
|
"#{items[path].compiled_content}" \
|
|
|
|
"</script>"
|
|
|
|
end
|
|
|
|
|
|
|
|
def inline_css(path)
|
|
|
|
class_name = File.basename(path, File.extname(path))
|
2024-05-26 07:56:50 +02:00
|
|
|
%|<style class="css #{class_name}">| \
|
2024-05-25 08:15:09 +02:00
|
|
|
"#{items[path.sub(".css", ".scss")].compiled_content}" \
|
2023-10-07 08:21:48 +02:00
|
|
|
"</style>"
|
|
|
|
end
|
|
|
|
end
|