From ed6c2ff48cb206989dc5eda79fe4a7a7ebc8e2aa Mon Sep 17 00:00:00 2001 From: Kunjan Dalal Date: Wed, 18 Sep 2024 22:24:19 +0530 Subject: [PATCH] Updating Spin Hub with Tera Sample Signed-off-by: Kunjan Dalal --- content/api/hub/sample_tera.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 content/api/hub/sample_tera.md diff --git a/content/api/hub/sample_tera.md b/content/api/hub/sample_tera.md new file mode 100644 index 000000000..cef764dd4 --- /dev/null +++ b/content/api/hub/sample_tera.md @@ -0,0 +1,25 @@ +title = "Tera Template Engine and Spin" +template = "render_hub_content_body" +date = "2024-09-17T00:00:00Z" +content-type = "text/html" +tags = ["rust", "templating" , "cookies"] + +[extra] +author = "kunjee17" +type = "hub_document" +category = "Sample" +language = "Rust" +created_at = "2024-09-17T00:00:00Z" +last_updated = "2024-09-17T00:00:00Z" +spin_version = ">=v2.0" +summary = "Example of how to load templates off of the filesystem and then render them. Also, covers creating session cookies and protected routes using cookies." +url = "https://github.com/kunjee17/spin_monolith" +keywords = "rust, tera, cookies" + +--- + +This is an example of using the [Tera template engine](https://keats.github.io/tera/) inside of a Fermyon Spin app. You will learn how to load templates off of the filesystem and then render them. + +Also, you will learn how to use session cookies to have protected route and how to use `form-post` to submit data to spin route. + +To get started, please visit the [GitHub repository](https://github.com/kunjee17/spin_monolith).