Files
marka/registry/templates.go
Max Richter c687eff53d big tings
2025-08-17 15:16:17 +02:00

26 lines
513 B
Go

// Package registry provides functionality for managing and accessing embedded file systems and directories.
package registry
import (
"embed"
"io"
)
//go:embed templates/*.marka
var templates embed.FS
func GetTemplate(name string) (string, error) {
templateFile, err := templates.Open("templates/" + name + ".marka")
if err != nil {
return "", err
}
defer templateFile.Close()
templateBytes, err := io.ReadAll(templateFile)
if err != nil {
return "", err
}
return string(templateBytes), nil
}