Ponzu という CMS admin tool が面白そうである。
Ponzu is a powerful and efficient open-source HTTP server framework and CMS. It provides automatic, free, and secure HTTP/2 over TLS (certificates obtained via Let’s Encrypt), a useful CMS and scaffolding to generate content editors, and a fast HTTP API on which to build modern applications.
links
Quick Start
required: Go 1.8+
install
go get github.com/ponzu-cms/ponzu/...
- operations
cd ~/prj/study/golang
mkdir ponzu
cd ponzu
export GOPATH=`pwd`:$GOPATH
ponzu new reviews
cd src/reviews
ponzu generate content review title:"string" author:"string" rating:"float64" body:"string":richtext website_url:"string" items:"[]string" photo:string:file
ponzu build
ponzu run
open http://localhost:8080/admin
Bookshelf
cd ~/prj/study/golang/ponzu
export GOPATH=`pwd`:$GOPATH
ponzu new bookshelf
cd src/bookshelf
- content author
ponzu gen c author name:string photo:string:file bio:string:richtext
ponzu build
ponzu run
- add String() on content/author.go
func (a *Author) String() string {
return a.Name
}
- content book
ponzu gen c book title:string author:@author,name pages:int year:int photos:'[]string':file
ponzu build
ponzu run
- add Push method
content/book.go
func (b *Book) Push() []string {
return []string{
"author",
"photos",
}
}
ponzu build
ponzu run --dev-https
https://localhost:10443/api/...
- add Create method
content/book.go
func (b *Book) Create(res http.ResponseWriter, req *http.Request) error {
return nil
}
func (b *Book) Approve(res http.ResponseWriter, req *http.Request) error {
return nil
}
// Approve --> AutoApprove
func (b *Book) String() string {
return fmt.Sprintf("%s (%d)", b.Title, b.Year)
}