diff --git a/pages/index.skooma.yue b/pages/index.skooma.yue index 9daa59e..79108ee 100644 --- a/pages/index.skooma.yue +++ b/pages/index.skooma.yue @@ -3,7 +3,9 @@ import output from require 'params' link = => a @title, href: "/"..output..@uri -(json) => (ul [li link post.head, prefix for post in *@]), { +(json) => { title "Index" script "window.posts = JSON.parse(`#{json}`)" -} +}, ( + ul [li link post.head, prefix for post in *@]) +) diff --git a/templates/main.skooma.yue b/templates/main.skooma.yue index b37301a..56a93e9 100644 --- a/templates/main.skooma.yue +++ b/templates/main.skooma.yue @@ -1,8 +1,9 @@ import output from require 'params' (...) => - content, head_content = @(...) - return render.html(html { + head_content, body_content = @(...) + body_content = head_content unless body_content + render.html(html { lang: "english" head { link rel: "stylesheet", href: "/#{output}/css/site.css" @@ -10,6 +11,6 @@ import output from require 'params' head_content } body { - content + body_content } }) diff --git a/templates/post.skooma.yue b/templates/post.skooma.yue index 22fe010..cac9f3e 100644 --- a/templates/post.skooma.yue +++ b/templates/post.skooma.yue @@ -2,16 +2,15 @@ import output from require 'params' url = (path) -> "/"..output..path -(attributes) => - { - nav { - ul { - li a "Index", href: url "/" - [li a post.head.title, href: url post.head.uri for post in *require("posts")] - } +(attributes) => { + title attributes.title + link rel: "stylesheet", href: "/#{output}/css/post.css" +}, { + nav { + ul { + li a "Index", href: url "/" + [li a post.head.title, href: url post.head.uri for post in *require("posts")] } - article { h1(attributes.title), @ } - }, { - title attributes.title - link rel: "stylesheet", href: "/#{output}/css/post.css" } + article { h1(attributes.title), @ } +}