[WIP] Begin blog index

This commit is contained in:
Jeremy Dormitzer 2019-06-08 13:30:17 -04:00
parent a950f6dce8
commit 9afcb7cec8
2 changed files with 28 additions and 1 deletions

22
src/blog/index.html.pm Normal file
View File

@ -0,0 +1,22 @@
#lang pollen
(require pollen/pagetree
pollen/file
racket/path)
(define here-path (select-from-metas 'here-path metas))
(define ptree (get-pagetree (build-path
(path-only (string->path here-path))
'up
"index.ptree")))
(current-pagetree ptree)
(define (get-posts)
(children 'blog))
for/splice[((post (get-posts)))]{
let[((src (get-source (path->string (path->complete-path (symbol->string post))))))]{
(string-append "blog/" (symbol->string post))
;link[#:href ◊post]{◊(select 'h1 src)}
}
}

View File

@ -1,4 +1,9 @@
#lang pollen
◊(require racket/string)
index.html
blog
◊`(blog
,@(map string->symbol
(remove "index.html"
(filter (lambda (p) (string-suffix? p ".html"))
(map path->string (directory-list "blog"))))))