perun

Discuss perun static site generator
2019-05-14T17:17:37.002200Z

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.

2019-05-14T17:21:17.004500Z

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.

2019-05-14T17:22:54.006Z

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.

2019-05-14T17:23:38.006700Z

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

2019-05-14T17:31:39.008900Z

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.

2019-05-14T17:32:33.009500Z

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.

2019-05-14T17:33:55.010100Z

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

2019-05-14T19:01:30.010900Z

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?

2019-05-14T19:26:11.011500Z

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.

2019-05-14T19:27:08.012Z

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

2019-05-14T20:10:32.013200Z

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.

2019-05-14T20:14:58.016400Z

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

2019-05-14T20:15:29.016800Z

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

2019-05-14T20:34:05.017300Z

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

2019-05-14T22:31:24.018500Z

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

2019-05-14T22:32:21.019300Z

@wiseman are you the wiseman of lemonodor btw?

2019-05-14T22:57:30.019500Z

@alandipert that’s me!

2019-05-14T23:02:38.020900Z

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

2019-05-14T23:14:59.021400Z

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