add index file for /{resource} paths
This commit is contained in:
parent
f9baec0fd8
commit
6f2040edff
4 changed files with 7 additions and 10 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1,3 @@
|
|||
**/**.**~
|
||||
**/.DS_Store
|
||||
|
||||
sorrel/**
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
(prefix-in files: web-server/dispatchers/dispatch-files)
|
||||
(prefix-in filter: web-server/dispatchers/dispatch-filter)
|
||||
(prefix-in sequencer: web-server/dispatchers/dispatch-sequencer)
|
||||
racket/runtime-path
|
||||
web-server/dispatchers/filesystem-map
|
||||
web-server/http
|
||||
csv-reading)
|
||||
|
@ -19,7 +20,6 @@
|
|||
(define-namespace-anchor anc)
|
||||
(define ns (namespace-anchor->namespace anc))
|
||||
|
||||
|
||||
(define (html-response content)
|
||||
(response/full
|
||||
200
|
||||
|
@ -42,7 +42,6 @@
|
|||
(build-path "source" type "index")
|
||||
(build-path "source" "index" ))
|
||||
#".txt")])
|
||||
(displayln res-path)
|
||||
(if (file-exists? res-path)
|
||||
(html-response (resource-processor res-path))
|
||||
(html-response (resource-processor "source/not-found.txt"))))]
|
||||
|
@ -74,14 +73,11 @@
|
|||
(xexpr->string (read (open-input-file file)))))
|
||||
|
||||
(define (build-index res)
|
||||
;; get all the entries in res table
|
||||
;; build index
|
||||
(let* ([table (csv->list (open-input-file
|
||||
(path-add-extension
|
||||
(build-path "data" res)
|
||||
#".csv")))]
|
||||
(build-path "data" res) #".csv")))]
|
||||
[make-index
|
||||
(read (open-input-file "data/make-index.txt"))]
|
||||
(read (open-input-file "source/make-index.txt"))]
|
||||
[index ((eval make-index ns) res (rest table))])
|
||||
(lambda (req)
|
||||
(if (equal? res "tagged")
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
(p (em (~a "everything (or maybe just some things) i've ever said about \"~a\"" tag)))))]
|
||||
[else
|
||||
'(hgroup (h1 "i'm lost")
|
||||
(p (em "you weren't meant to be here")))]))])
|
||||
(p (em "you weren't meant to be here")))])
|
||||
(h3 "the thoughts"))])
|
||||
(define (settled-post post)
|
||||
`((div ((class "post-preview"))
|
||||
(h4 ,(second post))
|
||||
|
|
|
@ -66,7 +66,7 @@ body {
|
|||
max-width: 600;
|
||||
margin: auto;
|
||||
font-size: medium;
|
||||
font-family: Verdana, ui-sans-serif;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
header{
|
||||
|
|
Loading…
Reference in a new issue