started doing framing

This commit is contained in:
2025-09-13 21:21:02 -06:00
parent ee2a8a7d2b
commit 5a437a0c64
6 changed files with 164 additions and 110 deletions
+37
View File
@@ -0,0 +1,37 @@
/*
* Amsterdam Web Communities System
* Copyright (c) 2025 Erbosoft Metaverse Design Solutions, All Rights Reserved
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package ui
import (
"io"
"github.com/CloudyKit/jet/v6"
"github.com/labstack/echo/v4"
)
var views = jet.NewSet(
jet.NewOSFileSystemLoader("./views"),
jet.DevelopmentMode(true),
)
type TemplateRenderer struct {
}
func (r *TemplateRenderer) Render(w io.Writer, name string, data any, c echo.Context) error {
view, err := views.GetTemplate(name)
if err != nil {
return err
}
var vmap jet.VarMap = nil
amctxt := AmContextFromEchoContext(c)
if amctxt != nil {
vmap = amctxt.VarMap()
}
return view.Execute(w, vmap, data)
}