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 = =>
|
link = =>
|
||||||
a @title, href: "/"..output..@uri
|
a @title, href: "/"..output..@uri
|
||||||
|
|
||||||
(json) => (ul [li link post.head, prefix for post in *@]), {
|
(json) => {
|
||||||
title "Index"
|
title "Index"
|
||||||
script "window.posts = JSON.parse(`#{json}`)"
|
script "window.posts = JSON.parse(`#{json}`)"
|
||||||
}
|
}, (
|
||||||
|
ul [li link post.head, prefix for post in *@])
|
||||||
|
)
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import output from require 'params'
|
import output from require 'params'
|
||||||
|
|
||||||
(...) =>
|
(...) =>
|
||||||
content, head_content = @(...)
|
head_content, body_content = @(...)
|
||||||
return render.html(html {
|
body_content = head_content unless body_content
|
||||||
|
render.html(html {
|
||||||
lang: "english"
|
lang: "english"
|
||||||
head {
|
head {
|
||||||
link rel: "stylesheet", href: "/#{output}/css/site.css"
|
link rel: "stylesheet", href: "/#{output}/css/site.css"
|
||||||
|
@ -10,6 +11,6 @@ import output from require 'params'
|
||||||
head_content
|
head_content
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
content
|
body_content
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,16 +2,15 @@ import output from require 'params'
|
||||||
|
|
||||||
url = (path) -> "/"..output..path
|
url = (path) -> "/"..output..path
|
||||||
|
|
||||||
(attributes) =>
|
(attributes) => {
|
||||||
{
|
title attributes.title
|
||||||
nav {
|
link rel: "stylesheet", href: "/#{output}/css/post.css"
|
||||||
ul {
|
}, {
|
||||||
li a "Index", href: url "/"
|
nav {
|
||||||
[li a post.head.title, href: url post.head.uri for post in *require("posts")]
|
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