示例#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
	)