drone / jkl

[DEPRECATED] a static site generator written in Go based on Jekyll
MIT License
132 stars 37 forks source link

fmt, vet, minor cleanups and one nasty bug squash #16

Closed gyepisam closed 11 years ago

gyepisam commented 11 years ago

Just started using jkl recently.

ran gofmt to cleanup

ran "go vet" which complained about a couple of minor errors, which are now fixed.

Ran into a nasty race condition bug where editing a layout while jkl runs with --server and --auto flags leads to a crash. Not sure if other editors do this, but with vim, when a file is edited and saved, the editor deletes the file before saving it. When the delete event occurs, jkl tries to regenerate the site, but eventually crashes when pkg/text/template discovers there's no layout file. Since the problem is generally transient we catch the error and propagate it up the change to main.recompile, which logs and otherwise ignores it.

Also added -- split categories and tags by comma separator and add each one separately.

I discovered the lack of splitting when trying to generate related posts, but I found the process too cumbersome to do in go template. I think more of the work needs to be done in jkl so the template doesn't have to contain too much logic. I'll scratch this itch when it gets strong enough

bradrydzewski commented 11 years ago

thanks for the changes!