perun

Discuss perun static site generator
podviaznikov 2017-02-09T17:11:10.000300Z

For some reason getting clj file in my fileset.

clojure boot build
[yaml-metadata] - parsed 1 files
[markdown] - parsed 1 markdown files
({:extension "clj",
  :filename "post.clj",
  :full-path "/Users/podviaznikov/.boot/cache/tmp/Users/podviaznikov/meetups/clojure/oom/-grrwi1/demo/blog/post.clj",
  :parent-path "demo/blog/",
  :path "demo/blog/post.clj",
  :permalink "/demo/blog/post.clj",
  :short-filename "post",
  :slug "post"}
 {:extension "html",
  :filename "2017-02-09-hello-world.html",
  :full-path "/Users/podviaznikov/.boot/cache/tmp/Users/podviaznikov/meetups/clojure/oom/f0sqpx/public/2017-02-09-hello-world.html",
  :include-atom true,
  :include-rss true,
  :original-path "2017-02-09-hello-world.md",
  :out-dir "public",
  :parent-path "public/",
  :path "public/2017-02-09-hello-world.html",
  :permalink "/2017-02-09-hello-world.html",
  :short-filename "2017-02-09-hello-world",
  :slug "2017-02-09-hello-world",
  :title "hello world",
  :io.perun/trace [:io.perun/yaml-metadata :io.perun/markdown]}
 {:extension "md",
  :filename "2017-02-09-hello-world.md",
  :full-path "/Users/podviaznikov/.boot/cache/tmp/Users/podviaznikov/meetups/clojure/oom/f0sqpx/2017-02-09-hello-world.md",
  :include-atom true,
  :include-rss true,
  :original true,
  :original-path "2017-02-09-hello-world.md",
  :parent-path "",
  :parsed "<h2><a href=\"#hello\" name=\"hello\"></a>Hello</h2>\n<p>Welcome to the Perun Hello World Demo</p>",
  :path "2017-02-09-hello-world.md",
  :permalink "/2017-02-09-hello-world.md",
  :short-filename "2017-02-09-hello-world",
  :slug "2017-02-09-hello-world",
  :title "hello world",
  :io.perun/trace [:io.perun/yaml-metadata :io.perun/markdown]})
[render] - rendered 1 pages
Writing target dir(s)…
My boot file looks like this
(set-env!
  :source-paths #{"src"}
  :resource-paths #{"resources"}
  :dependencies '[[perun "0.4.2-SNAPSHOT"]
                  [hiccup "1.0.5"]
                  [pandeiro/boot-http "0.6.3-SNAPSHOT"]])


(require '[clojure.string :as str]
         '[io.perun :refer :all]
         '[<http://demo.blog.post|demo.blog.post> :as post-view]
         '[pandeiro.boot-http :refer [serve]])


(deftask build
  "Build personal site"
  []
  (comp
    (markdown)
    (print-meta)
    (render :renderer '<http://demo.blog.post/render|demo.blog.post/render>)
    (target)
    ))
Was it always like that or is it just me doing something different?

bhagany 2017-02-09T18:01:48.000301Z

@podviaznikov it's a result of making the base task obsolete

bhagany 2017-02-09T18:02:18.000302Z

I added filterer and extensions to print-meta so that you could only print the things you're interested in

bhagany 2017-02-09T18:07:54.000303Z

Perhaps we should discuss this a little, actually. One of the things I changed was that some tasks would use boot/output-files to get the initial list of files before filtering, and now it uses boot/ls to get all files instead. I did this because I wanted it to be as flexible as possible, and for many use cases, only using a portion of the fileset limits what you can do.

bhagany 2017-02-09T18:08:38.000304Z

For instance, I wanted someone to be able to put an HTML file in resources and use it as input to render, but this wouldn't be possible with boot/output-files

bhagany 2017-02-09T18:09:19.000305Z

It did, however have this side effect where you see all files in your fileset when you do print-meta. A few options to make that better:

bhagany 2017-02-09T18:11:20.000306Z

- use a default for print-meta's extensions that excludes clj files. Might be hard to whitelist though, so I think it'd be better have to have an extension blacklist for this case.

bhagany 2017-02-09T18:12:00.000307Z

- establish a convention for what files Perun will consider that excludes boot/input-files (because this is where the clj files are)

podviaznikov 2017-02-09T18:54:15.000308Z

got it. No worries, was just curious if we had that for a long time. I also do see now that print-meta supports bunch of options. So it’s definitely not a problem for me

podviaznikov 2017-02-09T18:57:23.000309Z

maybe having both whitelist and backlist options is a good idea for the future, but don’t think it’s super important for now. filterer option is there and it can be filtered any way

bhagany 2017-02-09T19:38:28.000310Z

okay, sounds good to me