1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-02 02:36:24 -07:00

Add template loading to the templates manage action

This commit is contained in:
Eggbertx 2023-12-21 15:55:29 -08:00
parent a8436c5ee4
commit 7e07e24f16
6 changed files with 87 additions and 55 deletions

View file

@ -41,7 +41,7 @@ The following are modules that can be loaded via `require("modulename")`. See [.
## gctemplates
- **gctemplates.load_template(files...)**
- Calls [gctemplates.LoadTemplate](https://pkg.go.dev/github.com/gochan-org/gochan/pkg/gctemplates#LoadTemplate) using the given `files` and returns a [Template](https://pkg.go.dev/html/template#Template) and an error object (or nil if there were no errors).
- Loads the given file paths into a [Template](https://pkg.go.dev/html/template#Template), using the base filename as the name, and returns the template and an error if one occured.
- **gctemplates.parse_template(template_name string, template_data string)**
- Calls [gctemplates.ParseTemplate](https://pkg.go.dev/github.com/gochan-org/gochan/pkg/gctemplates#ParseTemplate) with the given template name and Go template data, and returns a [Template](https://pkg.go.dev/html/template#Template) and an error object (or nil if there were no errors).