Fork me on GitHub
#perun
<
2019-05-14
>
wiseman17:05:37

i’m exploring perun and i really like what i’ve seen so far. it feels like a really nice fit with boot, and it feels powerful & simple. i’m trying the example blog (https://github.com/hashobject/perun/tree/master/example-blog) and have a couple questions.

wiseman17:05:17

1. i don’t think i understand how to use images. e.g., i added 1.png to example-blog/resources so it’s a sibling of 2015-04-01-post1.md. after boot dev, post1.html is in target/public but 1.png is in target. since target/public is the docroot, i don’t see any way to create a url that will reference 1.png.

wiseman17:05:54

2. example-blog/build.boot contains (perun/inject-scripts :scripts #{"start.js"}) but it doesn’t seem to have any effect. i might expect about.html to include start.js, but it doesn’t. and similar to the png issue above, start.js is in target, not in target/public, so again i don’t know how you’d even create a url to reference it.

wiseman17:05:38

i guess i should take a look at the source to some other blogs that use perun to understand. (it might be nice if the example blog included an image though…)

wiseman17:05:39

ok, so re: #1 above, i see that i’d need to put 1.png in example-blog/resources/public to get it copied to target/public. the resource structure that i’d like is to have post assets be located with posts, so that i could even have a subdirectory for a post, and have the .md and all images and other assets in that subdirectory.

wiseman17:05:33

similar to what https://github.com/nhoizey/jekyll-postfiles does for jekyll. if anyone has any pointers to code that could achieve that, let me know.

wiseman17:05:55

i still don’t understand why inject-scripts doesn’t seem to have any effect in the example.

Eccentric J19:05:30

You might be able to achieve that using the boot API such as sift to rename files. As for the JS injection, is it linking to it or is it inlining the script?

wiseman19:05:11

oh, good call, @jayzawrotny. since it was copying the js file over i expected it to be linked to, but yes, it’s inlining it.

wiseman19:05:08

i guess it turns out using boot is a good fit in some ways, but also brings along unnecessary baggage.

Eccentric J20:05:32

That’s fair. Perun is interesting in that it’s pretty customizable in terms of behavior but at the same time boot is very opinionated about what you can do and when.

Eccentric J20:05:58

@wiseman If you’re looking for a possible alternative, I was able to combine ClojureScript + Gulp + Highland JS to make a static site generator using stream transformations. The advantage is that like boot you are working in pipelines of behaviors with the benefits of faster start times plus access the entire plethora of node js front-end tooling. https://github.com/eccentric-j/benfrankenberg.com/tree/master/src/com/benfrankenberg/tasks I’m thinking of writing some tutorials for this so others can comfortably roll their own.

Eccentric J20:05:29

Though I still like perun provided it fits your use case.

wiseman20:05:05

interesting. i’d generally prefer a clojurescript-based system actually.

alandipert22:05:24

i think boot/perun great for many things, but i personally somehow arrived at makefile + elisp blogware

alandipert22:05:21

@wiseman are you the wiseman of lemonodor btw?

alandipert23:05:38

neat, nice to see you on here! i think maybe you wound it down before i got into lisp but i fondly remember the swank message “Lemonodor-fame is but a hack away.” and i read many of the CL posts from the renaissance

wiseman23:05:59

ha, that’s great. glad you got something out of it