aboutsummaryrefslogtreecommitdiff
path: root/src/guff/views/html
diff options
context:
space:
mode:
Diffstat (limited to 'src/guff/views/html')
-rw-r--r--src/guff/views/html/page.cr7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/guff/views/html/page.cr b/src/guff/views/html/page.cr
index a902e0b..6ea9502 100644
--- a/src/guff/views/html/page.cr
+++ b/src/guff/views/html/page.cr
@@ -31,10 +31,13 @@ module Guff
end
def body_attrs
- {
+ r = {
"id": @body_id,
"class": @body_class,
- }.map { |k, v| attr(k, v) }.join(" ")
+ }.map { |k, v| attr(k, v) }.join(" ").strip
+
+ # prefix with space if content
+ " " + r if r.size > 0
end
def page_headers : String