perun

Discuss perun static site generator
sooheon 2017-02-16T04:08:37.000385Z

Hey little heads up on the docs, the builtins guide mentions static which doesn’t exist

sooheon 2017-02-16T04:09:19.000386Z

I’m wondering what I should use for an about page. Just collection that doesnt use any entries?

podviaznikov 2017-02-16T04:13:26.000387Z

@sooheon static should exist if you use latest perun snapshot version, which is perun 0.4.2-SNAPSHOT. Which version do you use now?

sooheon 2017-02-16T04:13:42.000388Z

Ah it’s in snapshot ok. I’m on 0.4.1, will upgrade

podviaznikov 2017-02-16T04:14:48.000389Z

yeah, static is a new one

sooheon 2017-02-16T04:16:38.000390Z

hm was there an api change from 0.4.1 for slug? my old slug-fn doesnt work

podviaznikov 2017-02-16T04:19:24.000393Z

I think it has few breaking changes. what is your slug function?

sooheon 2017-02-16T04:19:49.000394Z

(defn slug-fn [filename]
  "Parses `slug` portion out of the filename in the format: slug-title.ext"
  (->> (string/split filename #"[-\.]")
       drop-last
       (string/join "-")
       string/lower-case))

podviaznikov 2017-02-16T04:21:36.000400Z

try changing signature to slug-fn [_ filename]

podviaznikov 2017-02-16T04:21:57.000401Z

and using filename like this (:filename m)

sooheon 2017-02-16T04:22:56.000402Z

Got it. Think I need to update a few others along the same lines

sooheon 2017-02-16T04:22:57.000403Z

THanks

podviaznikov 2017-02-16T04:24:32.000404Z

no problems. if you have more question, post them here

sooheon 2017-02-16T05:00:43.000405Z

@podviaznikov Hey do you mind taking a look at https://github.com/sooheon/sooheon.com/tree/update-perun (run locally with boot dev), and comparing with the master branch? The collection and render renderer fns seem to work differently, but I cant figure out how.

podviaznikov 2017-02-16T05:50:24.000407Z

taking a look now

sooheon 2017-02-16T05:50:29.000408Z

Am I correct that there was a change from having the result of markdown be in :content key to it just outputting .html files in the public directory?

sooheon 2017-02-16T05:50:41.000409Z

podviaznikov I resolved those issues I was having before

sooheon 2017-02-16T05:51:00.000410Z

But now it looks like all of my markdown files, even marked :draft true will be rendered

podviaznikov 2017-02-16T05:51:02.000411Z

yeah, that is a big one. You are correct

sooheon 2017-02-16T05:51:12.000412Z

and just typing it in the browser takes you to it

sooheon 2017-02-16T05:52:16.000413Z

Ah my bad, I was calling draft before markdown, but markdown includes the yaml reader

sooheon 2017-02-16T05:53:16.000414Z

How should I rewrite draft if I want it to exclude not based on yaml data but based on say path?

sooheon 2017-02-16T05:53:30.000415Z

so that I can exclude before markdown rendering happens

sooheon 2017-02-16T05:54:30.000416Z

Ah markdown takes a filterer

podviaznikov 2017-02-16T05:54:41.000417Z

yeah, was just going to say that

sooheon 2017-02-16T05:55:10.000418Z

Nice. I really like this boot task based way. It’s easier to introspect

sooheon 2017-02-16T05:55:16.000419Z

intermediate values and so on

podviaznikov 2017-02-16T05:55:19.000420Z

I think every task takes filterer

podviaznikov 2017-02-16T05:55:59.000421Z

yeah, I like it too. I usually also add target task at the end and see what files got rendered

podviaznikov 2017-02-16T05:56:05.000422Z

helps me with debugging

sooheon 2017-02-16T05:56:21.000423Z

this is more of a boot question, but there’s no way to change running tasks, right? say I change the filterer of a task, and I have boot dev running, I dont think that takes effect unless I restart the task

podviaznikov 2017-02-16T05:57:37.000424Z

I think if you can start repl and load boot tasks from repl then you can reload them

podviaznikov 2017-02-16T05:57:47.000425Z

I saw last week some post how to do that in boot

podviaznikov 2017-02-16T05:57:51.000426Z

but never tried myself

podviaznikov 2017-02-16T05:57:56.000427Z

let me try to find that link

podviaznikov 2017-02-16T05:59:23.000430Z

here it is. Didn’t try it myself

sooheon 2017-02-16T06:00:06.000431Z

That sounds awesome. This is what I thought all those boot-reload dependencies should have done :)

sooheon 2017-02-16T07:23:49.000432Z

So podviaznikov’s method works, except that for our use case boot-http’s serve task is not suited for this, because it doesnt stop the server unless the repl is left. So you should separate the task further leaving out serve

bhagany 2017-02-16T12:01:43.000433Z

@sooheon I ran into the same problem. If you'd like, you can build and run this branch of boot-http, which fixes that bug. https://github.com/pandeiro/boot-http/pull/59

sooheon 2017-02-16T12:04:24.000435Z

Ah yeah I saw your PR in the github thread as well. Thanks! It seems like some awesome sleuthing

bhagany 2017-02-16T12:09:22.000436Z

You're welcome, and thanks, I appreciate the compliment 😊

bhagany 2017-02-16T12:40:20.000437Z

Also, reading back a bit - if your concern about rendering markdown files with draft: true is about the performance - you will only pay that cost on the first run of your watch loop, assuming the original file doesn't change. And (comp (markdown) (draft)) will result in a fileset that doesn't have those rendered files