Switch head and body content around in template

This commit is contained in:
Talia 2022-03-26 09:09:13 +01:00
parent dbaf7e963c
commit 5b04f9e0ae
Signed by: darkwiiplayer
GPG key ID: 7808674088232B3E
3 changed files with 18 additions and 16 deletions

View file

@ -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 *@])
)

View file

@ -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
}
})

View file

@ -2,8 +2,10 @@ import output from require 'params'
url = (path) -> "/"..output..path
(attributes) =>
{
(attributes) => {
title attributes.title
link rel: "stylesheet", href: "/#{output}/css/post.css"
}, {
nav {
ul {
li a "Index", href: url "/"
@ -11,7 +13,4 @@ url = (path) -> "/"..output..path
}
}
article { h1(attributes.title), @ }
}, {
title attributes.title
link rel: "stylesheet", href: "/#{output}/css/post.css"
}
}