stevenleeg / gobb

A simple and fast bulletin board written in Go.
Other
131 stars 26 forks source link

reworking where templates are #27

Closed jamesa closed 10 years ago

jamesa commented 10 years ago

Need me some code review on this.

This commit basically just moves the default templates into templates/default, and it removes some logic about specifying a custom path in config for those templates. So that's a small limitation of this, but at least now there's an obvious place to put custom templates.

Also a favicon has been added to the default template, if you set your favicon image to /static/images/favicon.png.

One of the interesting things is that the URLs for stylesheets, scripts, and such will always be the same no matter the theme. So I'm not sure if that's something that we'd want to change. But /static/style.css would be completely different if an admin changed the site's templates. If a user had a cached stylesheet that referred to some different HTML or something, that could get weird.

stevenleeg commented 10 years ago

This looks good, but the main problem is that we don't want users adding in custom templates within the project's filesystem (in the GOPATH).

Ideally you should be able to distribute a binary of gobb, pass it a config variable (I used base_path) and put all of your customized code there (eg templates, static files, etc.). If we required users to put templates within the GOPATH we would also be losing the ability to distribute gobb as a standalone binary (which is one of the really nice benefits of deploying applications with Go).

jamesa commented 10 years ago

Hmm that's very true. Guess this could be a step backwards then, even though at first glance it appears simpler.