Use blog post component in index

This commit is contained in:
Talia 2022-03-26 14:26:37 +01:00
parent 82ad12ba8f
commit f0ccbdbacc
Signed by: darkwiiplayer
GPG key ID: 7808674088232B3E

View file

@ -1,11 +1,16 @@
import output from require 'params' import output from require 'params'
link = => post = =>
a @title, href: "/"..output..@uri blogPost {
name: @head.slug
a @head.title, href: "/"..output..@head.uri
}
(json) => { (json) => {
title "Index" title "Index"
script "window.posts = JSON.parse(`#{json}`)" script "window.posts = JSON.parse(`#{json}`)"
script type: 'module', src: "/#{output}/javascript/BlogPost.js"
script type: 'module', src: "/#{output}/javascript/LocalDate.js"
}, ( }, (
ul [li link post.head, prefix for post in *@]) ul [li post p for p in *@]
) )