From 57b8ffc481a8bdd5e1b4dd4f84dc39569ab9b39c Mon Sep 17 00:00:00 2001 From: risotto Date: Mon, 7 Apr 2025 05:35:41 -0600 Subject: [PATCH] move example --- example/.gitignore | 1 + .../example_templates}/base.html | 0 .../example_templates}/error.html | 0 .../example_templates}/home.html | 0 .../example_templates}/nav.html | 0 example_test.go => example/example_test.go | 2 +- example/main.go | 14 ++++++++++++++ 7 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 example/.gitignore rename {example_templates => example/example_templates}/base.html (100%) rename {example_templates => example/example_templates}/error.html (100%) rename {example_templates => example/example_templates}/home.html (100%) rename {example_templates => example/example_templates}/nav.html (100%) rename example_test.go => example/example_test.go (96%) create mode 100644 example/main.go diff --git a/example/.gitignore b/example/.gitignore new file mode 100644 index 0000000..96236f8 --- /dev/null +++ b/example/.gitignore @@ -0,0 +1 @@ +example \ No newline at end of file diff --git a/example_templates/base.html b/example/example_templates/base.html similarity index 100% rename from example_templates/base.html rename to example/example_templates/base.html diff --git a/example_templates/error.html b/example/example_templates/error.html similarity index 100% rename from example_templates/error.html rename to example/example_templates/error.html diff --git a/example_templates/home.html b/example/example_templates/home.html similarity index 100% rename from example_templates/home.html rename to example/example_templates/home.html diff --git a/example_templates/nav.html b/example/example_templates/nav.html similarity index 100% rename from example_templates/nav.html rename to example/example_templates/nav.html diff --git a/example_test.go b/example/example_test.go similarity index 96% rename from example_test.go rename to example/example_test.go index 1063010..4c2af7a 100644 --- a/example_test.go +++ b/example/example_test.go @@ -1,4 +1,4 @@ -package templates_test +package main_test import ( "embed" diff --git a/example/main.go b/example/main.go new file mode 100644 index 0000000..2d4cccb --- /dev/null +++ b/example/main.go @@ -0,0 +1,14 @@ +package main + +import ( + "embed" + + "git.bivouac.wiki/use/templates" +) + +//go:embed example_templates +var tpfs embed.FS + +func main() { + templates.NewTemplates(tpfs, "example_templates") +}