Upgrade to Bulma 1.0.2.

This commit is contained in:
mikestefanello 2025-02-18 19:19:09 -05:00
parent 3eab2f5562
commit acbc5e4bf6
7 changed files with 21 additions and 43 deletions

View file

@ -3,7 +3,6 @@ package funcmap
import (
"fmt"
"html/template"
"reflect"
"strings"
"github.com/Masterminds/sprig"
@ -29,7 +28,6 @@ func NewFuncMap(web *echo.Echo) template.FuncMap {
funcs := sprig.FuncMap()
// Include all the custom functions
funcs["hasField"] = fm.hasField
funcs["file"] = fm.file
funcs["link"] = fm.link
funcs["url"] = fm.url
@ -37,18 +35,6 @@ func NewFuncMap(web *echo.Echo) template.FuncMap {
return funcs
}
// hasField checks if an interface contains a given field
func (fm *funcMap) hasField(v any, name string) bool {
rv := reflect.ValueOf(v)
if rv.Kind() == reflect.Ptr {
rv = rv.Elem()
}
if rv.Kind() != reflect.Struct {
return false
}
return rv.FieldByName(name).IsValid()
}
// file appends a cache buster to a given filepath so it can remain cached until the app is restarted
func (fm *funcMap) file(filepath string) string {
return fmt.Sprintf("/%s/%s?v=%s", config.StaticPrefix, filepath, CacheBuster)