aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/guff/views/page.cr12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/guff/views/page.cr b/src/guff/views/page.cr
index eb53dec..b1019a6 100644
--- a/src/guff/views/page.cr
+++ b/src/guff/views/page.cr
@@ -12,12 +12,16 @@ class Guff::Views::PageView < Guff::Views::HTMLView
end
private def scripts
- super(theme_assets.scripts)
+ super(theme_assets.scripts.map { |val|
+ "/guff/themes/%s/%s" % [theme_slug, val]
+ })
# TODO: allow page-specific scripts
end
private def styles
- super(theme_assets.styles)
+ super(theme_assets.styles.map { |val|
+ "/guff/themes/%s/%s" % [theme_slug, val]
+ })
# TODO: allow page-specific styles
end
@@ -25,5 +29,9 @@ class Guff::Views::PageView < Guff::Views::HTMLView
@context.models.theme.assets(@theme_id)
end
+ private def theme_slug : String
+ @theme_slug ||= @context.models.theme.get(@theme_id)["theme_slug"] as String
+ end
+
ECR.def_to_s("src/views/page.ecr")
end