diff --git a/Server.go b/Server.go index 22d4567..093080c 100644 --- a/Server.go +++ b/Server.go @@ -17,8 +17,9 @@ import ( var SERVER_HEADER string = `contented/0.0.0-dev` type ServerPublicProperties struct { - AppTitle string - MaxUploadBytes int64 + AppTitle string + MaxUploadBytes int64 + CanonicalBaseURL string } type ServerOptions struct { diff --git a/preview.go b/preview.go index 84f6f6f..b43b416 100644 --- a/preview.go +++ b/preview.go @@ -15,10 +15,31 @@ func (this *Server) handlePreview(w http.ResponseWriter, fileIDList string) { fileIDs := strings.Split(fileIDList, `-`) tmpl := ` - + ` + html.EscapeString(this.opts.ServerPublicProperties.AppTitle) + ` - + + + + +` + + if len(this.opts.ServerPublicPropertyies.CanonicalBaseURL) > 0 { + tmpl += ` + + ` + } + + for _, fileID := range fileIDs { + tmpl += ` + + + + + ` + } + + tmpl += `