perkeep/doc/publishing
mpl a6aeff034c server/publish.go: use go html template for publishing
Change-Id: Ic1c55d35e52e407864d339927b453de58a64e03c
2013-11-19 17:50:26 +01:00
..
README server/publish.go: use go html template for publishing 2013-11-19 17:50:26 +01:00

README

Camlistore uses Go html templates (http://golang.org/pkg/text/template/) to publish pages.

Resources for publishing, such as go templates, javascript and css files should be placed in server/camlistored/ui/, so they can be served directly when using the dev server or automatically embedded when using camlistored directly.

You can then specify those resources through the configuration file. For example, there already is a go template (gallery.html), javascript file (pics.js) and css file (pics.css) that work together to provide publishing for image galleries. The dev server config (config/dev-server-config.json) already uses them. Here is how one would use them in the server config ($HOME/.config/camlistore/server-config.json):

"publish": {
	"/pics/": {
		"rootPermanode": "sha1-6cbe9e1c35e854eab028cba43d099d35ceae0de8",
		"style": "pics.css",
		"js": "pics.js",
		"goTemplate": "gallery.html"
	}
}

If you want to provide your own (Go) template, see http://camlistore.org/pkg/publish for the data structures and functions available to the template.