better orte

This commit is contained in:
Simon Martens
2025-09-25 17:47:17 +02:00
parent 9849764f76
commit 7796b386f0
4 changed files with 190 additions and 49 deletions

View File

@@ -3,6 +3,7 @@ package app
import (
"os"
"path/filepath"
"strings"
"sync"
"github.com/Theodor-Springmann-Stiftung/kgpz_web/controllers"
@@ -212,6 +213,14 @@ func (k *KGPZ) Funcs() map[string]interface{} {
e["GetGND"] = k.GND.Person
e["GetGeonames"] = k.Geonames.Place
// Math functions
e["sub"] = func(a, b int) int { return a - b }
e["add"] = func(a, b int) int { return a + b }
// String functions
e["contains"] = func(s, substr string) bool { return strings.Contains(s, substr) }
e["lower"] = func(s string) string { return strings.ToLower(s) }
e["LookupPieces"] = k.Library.Pieces.ReverseLookup
e["LookupWorks"] = k.Library.Works.ReverseLookup
e["LookupIssues"] = k.Library.Issues.ReverseLookup