Switch head and body content around in template
This commit is contained in:
parent
dbaf7e963c
commit
5b04f9e0ae
3 changed files with 18 additions and 16 deletions
|
@ -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 *@])
|
||||
)
|
||||
|
|
|
@ -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
|
||||
}
|
||||
})
|
||||
|
|
|
@ -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), @ }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue