Fork me on GitHub
#perun
<
2017-02-16
>
sooheon04:02:37

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

sooheon04:02:19

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

podviaznikov04:02:26

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

sooheon04:02:42

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

podviaznikov04:02:48

yeah, static is a new one

sooheon04:02:38

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

podviaznikov04:02:24

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

sooheon04:02:49

(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))

podviaznikov04:02:36

try changing signature to slug-fn [_ filename]

podviaznikov04:02:57

and using filename like this (:filename m)

sooheon04:02:56

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

podviaznikov04:02:32

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

sooheon05:02:43

@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.

podviaznikov05:02:24

taking a look now

sooheon05:02:29

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?

sooheon05:02:41

podviaznikov I resolved those issues I was having before

sooheon05:02:00

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

podviaznikov05:02:02

yeah, that is a big one. You are correct

sooheon05:02:12

and just typing it in the browser takes you to it

sooheon05:02:16

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

sooheon05:02:16

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

sooheon05:02:30

so that I can exclude before markdown rendering happens

sooheon05:02:30

Ah markdown takes a filterer

podviaznikov05:02:41

yeah, was just going to say that

sooheon05:02:10

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

sooheon05:02:16

intermediate values and so on

podviaznikov05:02:19

I think every task takes filterer

podviaznikov05:02:59

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

podviaznikov05:02:05

helps me with debugging

sooheon05:02:21

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

podviaznikov05:02:37

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

podviaznikov05:02:47

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

podviaznikov05:02:51

but never tried myself

podviaznikov05:02:56

let me try to find that link

podviaznikov05:02:23

here it is. Didn’t try it myself

sooheon06:02:06

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

sooheon07:02:49

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

bhagany12:02:43

@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

sooheon12:02:24

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

bhagany12:02:22

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

bhagany12:02:20

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