perun 2016-12-26

@petrus has joined the channel

Anyone around still using Perun? I’m struggling to get it going even though I followed the Getting Started page.

@petrus I'm using it right now

just discovered there hasn't been a release since Jan. It'd be great to get a new version out guys! (I'm interested in render's meta options)

I’m getting this error:

❯ boot dev                                                                                                                                                                                    [13:27:49]
             clojure.lang.ExceptionInfo: java.lang.IllegalArgumentException: option :renderer must be of type sym
    data: {:file
           "/var/folders/8j/27sz_2rj0kd1b3v9y4n1_1t00000gn/T/boot.user1717875104820046032.clj",
           :line 29}
with this simple definion of renderer:
(defn renderer [{global :meta posts :entries post :entry}] (:name post))

(deftask build-dev
  "Build blog but don't push anywhere. Todo: combine this with prod."
  []
  (comp (markdown)
    (render :renderer renderer)
    (notify)))
But I can run ❯ boot serve --resource-root public markdown render -r site.core/page wait when site.core/page is a fn.

Have tried (render :renderer ‘#renderer) but no luck

try 'site.core/page

Is there a way I can keep boot “running” so I don’t have to wait for the JVM? I.e. run boot tasks from REPL

do boot repl

than call (boot "dev") etc

Ok so 'render-fn almost works. I’m getting:

Starting file watcher (CTRL-C to quit)...

[markdown] - parsed 1 markdown files
java.lang.AssertionError: Assert failed: (namespace sym)
              io.perun/render-in-pod     perun.clj:  374
          io.perun/eval2147/fn/fn/fn     perun.clj:  403
          io.perun/eval1651/fn/fn/fn     perun.clj:  116
boot.task.built-in/fn/fn/fn/fn/fn/fn  built_in.clj:  264
   boot.task.built-in/fn/fn/fn/fn/fn  built_in.clj:  264
      boot.task.built-in/fn/fn/fn/fn  built_in.clj:  261
                 boot.core/run-tasks      core.clj:  794
                   boot.core/boot/fn      core.clj:  804
 clojure.core/binding-conveyor-fn/fn      core.clj: 1916
                                 ...
Elapsed time: 0.426 sec

using (render :renderer 'page)

like I told you

'your.namsepace/page

I have it defined in the build.boot namespace

Is there a name for the “local” namespace?

(defn page [data]
  (html5
    [:div {:style "max-width: 900px; margin: 40px auto;"}
     [:h2 "tstsrt"]
     (-> data :entry :content)]))

(deftask build-dev
  "Build blog but don't push anywhere. Todo: combine this with prod."
  []
  (comp (markdown)
    (render :renderer 'page)
    (notify)))

'boot.user/page

but not sure if that works, given that it's going to be run in a pod

may be better to use a separate ns for that

yayyy

voila. working! Now if only I can inject a boot-reload websocket thing to reload the page on render...

I just did that

I’m getting the notify OSX alerts

it automatically reloads when you update an md file, or even css file

I see you’re calling sync-bucket

it's confetti

Is weasel for the reload websocket, or something else?

weasel is for the example projects, not needed

I also include the code examples in the blog source, in example-src

cool. how are you using reagent in your static site?

ah, ok

some of the examples are based on reagent

also boot-reload was easier to than boot-livereload

well, "easy" is relative

where are you injecting the JS to reload on the boot trigger?

look for include-js

I'm going out for a Christmas walk, but will be back later

it's weird that you can't pass any arguments to your render fn from build.boot

Is it possible to use boot-reload without ClojureScript?

thanks for the help, @pesterhazy

I don't think so...

@petrus, I've pushed a change to my repo to have a dev version (with reloading) and prod version (without)

@pesterhazy did you choose env vars over the .edn file intentionally

I like to have all my credentials in a .envrc

it's a very nice setup

cool, what's that?

is that read into the env upon cd

yes, it's a revelation. I use it for every project now

it's great for teams too, where everyone can use their own AWS key, customizations etc.

that's pretty cool indeed

Think I heard about it before but somehow thought it would be incompatible with fish. But seems it supports a bunch of shells

it's written in go though? A program for setting env vars? 😄

it's the future man, go with the flow