aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-07-25 22:09:32 -0400
committerPaul Duncan <pabs@pablotron.org>2016-07-25 22:09:32 -0400
commit7c896b0612180104efc516d1f078b8400fa28fa9 (patch)
tree613dbfde3d09530321c9742ba7e3fd9aa34f3c65 /src
parentc2a20d2fdef43cf2967919295ba7cf6ecffe57fc (diff)
downloadguff-7c896b0612180104efc516d1f078b8400fa28fa9.tar.bz2
guff-7c896b0612180104efc516d1f078b8400fa28fa9.zip
add theme assets to page renderer
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