예제 #1
0
파일: news_test.go 프로젝트: fd/simplex
func TestSite(t *testing.T) {
	stesting.Golden(
		t,
		static.GeneratorFunc(Generate),
	)
}
예제 #2
0
파일: news.go 프로젝트: fd/simplex
package example

import (
	"fmt"
	"html/template"
	"simplex.sh/container"
	"simplex.sh/paginate"
	"simplex.sh/shttp"
	"simplex.sh/static"
	"time"
)

var _ = container.App(func(app *container.Application) {
	app.Name = "example"

	app.Generator = static.GeneratorFunc(Generate)

	app.ExtraHosts = []string{"example.dev.", "*."}
})

type Article struct {
	Id          int
	Title       string
	Body        string
	PublishedAt time.Time
}

func Generate(tx *static.Tx) {
	var (
		articles *static.C
	)