@@ -26,33 +26,35 @@ (require "crystalize.rkt" "snippets-html.rkt" racket/file sugar/list) + +(provide main) ;; How many items per blog page -(define per-page 1) +(define per-page 5) ;; Returns a string containing the entire HTML contents of a given blog page (define (blog-page posts-str pagenum total-pages) (define page-nav (html$-paginate-navlinks pagenum total-pages "blog")) ◊string-append{ - - -◊html$-page-head[(format "The Local Yarn: Blog, p. ~a" pagenum)] -◊html$-page-body-open[] - - - - - -◊posts-str - - - -◊html$-page-body-close[] -}) + + + ◊html$-page-head[(format "The Local Yarn: Blog, p. ~a" pagenum)] + ◊html$-page-body-open[] + + + + + + ◊posts-str + + + + ◊html$-page-body-close[] + }) ;; Grabs all the articles+notes from the cache and writes out all the blog page files (define (build-blog) (spell-of-summoning!) ; Turn on the DB @@ -60,13 +62,14 @@ (define pagecount (length articles+notes)) (for ([pagenum (in-range 1 (+ 1 pagecount))] [page (in-list articles+notes)]) (define filename (format "blog-pg~a.html" pagenum)) - (println (format "Writing: ~a" filename)) + (displayln (format "Writing: ~a" filename)) (display-to-file (blog-page (apply string-append page) pagenum pagecount) filename #:mode 'text #:exists 'replace))) -;; Do it! -(build-blog) +(define (main) + ;; Do it! + (build-blog))