package yatwiki3 import ( "fmt" "html/template" "time" ) var subresourceNonce = time.Now().Unix() type pageTemplateOptions struct { CurrentPageIsArticle bool CurrentPageName string WikiTitle string Content template.HTML BaseURL string LoadCodeResources bool DefaultPage string AllowDownload bool SessionMessage template.HTML } func DefaultPageTemplateOptions(opts *ServerOptions) *pageTemplateOptions { return &pageTemplateOptions{ WikiTitle: opts.PageTitle, BaseURL: opts.ExpectBaseURL, DefaultPage: opts.DefaultPage, AllowDownload: opts.AllowDBDownload, } } func (this *pageTemplateOptions) NewArticleTitle() string { return fmt.Sprintf("untitled-%d", time.Now().Unix()) } func (this *pageTemplateOptions) SubresourceNonce() int64 { return subresourceNonce } const pageTemplate string = `