perun

Discuss perun static site generator
Vincenzo Piombo 2020-02-27T09:25:33.007600Z

I did this:

(deftask move-assets []
         (comp
           (sift "-m" "css/(.*)$:public/assets/css/$1")
           (sift "-m" "fonts/(.*)$:public/assets/fonts/$1")
           (sift "-m" "img/(.*)$:public/assets/img/$1")
           (sift "-m" "js/(.*)$:public/assets/js/$1")
           (sift "-m" "bootstrap/public/assets/(.*)$:public/assets/bootstrap/$1")
           ))

(deftask build-from-template
         "build the site modifying site-template"
         []
         (comp
           (perun/global-metadata)
           (perun/print-meta)
           (perun/markdown)
           (perun/render :renderer '<http://io.embarassed.post/render|io.embarassed.post/render>)
           (perun/collection :renderer 'io.embarassed.index/render :page "index.html")
           (move-assets)
           (target "-d" "../target")
           ))
and the renderer is this one:
(ns io.embarassed.index
  (:require [io.embarassed.common :as common]
            [hiccup.page :refer [html5]]
            [hickory.core :refer (parse)]
            [hickory.convert :refer (hickory-to-hiccup)]
            [hiccup.core :refer (html)]))



(defn render [{global-meta :meta posts :entries}]
  (let [s (slurp "site-template/index.html")
        dom (parse s)
        ]
    (html5 dom)))
It now works, but only after I copied the entire http://io.pe