shift72 / kibble

Apache License 2.0
2 stars 1 forks source link

Support rendering static files non root directories #71

Open sarge opened 3 years ago

sarge commented 3 years ago

Currently only static filename.jet templates get rendered if they are in the root path.

This is managed by https://github.com/shift72/kibble/blob/master/kibble/render/render.go#L129-L152

To render files in other directories we could do one of 3 things. a) provide a list of directories to check b) check all directories except the convention of templates c) refactor the rendering into a datasource being FileSystem. This will find all jet files in the folder and render them

 {
            "name": "dir1",
            "urlPath": "/dir1",
            "datasource": "FileSystem"
 },
stajs commented 3 years ago

I don't understand the work involved for c) but suspect a) and b) to be less work, and would prefer a) to not blindly scan all dirs when the majority of sites won't have any outside them. If a) was chosen, would you pass the list of dirs in via kibble.json?

sarge commented 3 years ago

@stajs Ended up going with c) as it gave some scope for including or excluding files for each language. Some clean up included which made the effort look larger than it was.