Is there a clean way to define where the resources folder will be once a luminus app is jarred? Other than setting all my paths to "../etc"
What do you mean with "where it will be"? In JVM programs, the resources folders are contained inside of the .jar, and you will generally not have to worry about "where" exactly they are as everything's managed. If you want to load external files (outside of the jar) those have nothing to do with the "resources" or resource paths you define in your project.
You simply use
(slurp <FILEPATH>) (or whatever) to read external files.
also I like that you called it "jarred" 😄
I've tried to follow this example from yogthos however there are now MIME type problems which I don't understand
Azzurite, I'd like to be able to update the media resources but not compile each time
You have to remember that Luminus is not its own thing, but simply a collection of different libraries. For example, your HTML templates are handled by selmer (https://github.com/yogthos/Selmer#resource-path), so if you set selmer's resource path, that's where the HTML template files will come from.
However, media resources are served by a ring middleware (you should be familiar with https://github.com/ring-clojure/ring/wiki/Concepts as Ring is the basis for every Clojure webapp). I'm not absolutely familiar with if Luminus uses the same libraries with all parameters, but the reagent template I have here uses https://github.com/ring-clojure/ring-defaults which by extension uses
You can see in the ring-defaults documentation that you have to change the
:static->`:files` configuration parameter to serve static files from the file system.
and yeah, the example from yogthos only changes the Selmer template path, but you're talking about "media resources", so I imagine you mean stuff like images
for which you'd have to change the
ring-defaults middleware options so that they're loaded from the file system
ok thanks for the detailed answer!
let me know if it helps, I've actually never used this stuff before 😄
ok, ideally, the whole folder would sit outside the jar as the logic will stay the same but styling/images will change
I'll give it a go, cheers 👍