diff --git a/template_versioned_docs/version-pug_v2.x.x/django/README.md b/template_versioned_docs/version-pug_v2.x.x/django/README.md index c8f33e726cf..ce7799deef8 100644 --- a/template_versioned_docs/version-pug_v2.x.x/django/README.md +++ b/template_versioned_docs/version-pug_v2.x.x/django/README.md @@ -181,3 +181,17 @@ Hello, World!

Greetings from Fiber Team ``` + +### Important Information on Template Data Binding + +When working with Pongo2 and this template engine, it's crucial to understand the specific rules for data binding. Only keys that match the following regular expression are supported: `^[a-zA-Z0-9_]+$`. + +This means that keys with special characters or punctuation, such as `my-key` or `my.key`, are not compatible and will not be bound to the template. This is a restriction imposed by the underlying Pongo2 template engine. Please ensure your keys adhere to these rules to avoid any binding issues. + +If you need to access a value in the template that doesn't adhere to the key naming restrictions imposed by the Pongo2 template engine, you can bind the value to a new field when calling `fiber.Render`. Here's an example: + +```go +c.Render("index", fiber.Map{ + "Fiber": "Hello, World!\n\nGreetings from Fiber Team", + "MyKey": c.Locals("my-key"), +}) \ No newline at end of file diff --git a/template_versioned_docs/version-pug_v2.x.x/handlebars/README.md b/template_versioned_docs/version-pug_v2.x.x/handlebars/README.md index c2b3ee8ae9d..07faeee1435 100644 --- a/template_versioned_docs/version-pug_v2.x.x/handlebars/README.md +++ b/template_versioned_docs/version-pug_v2.x.x/handlebars/README.md @@ -3,7 +3,7 @@ id: handlebars title: Handlebars --- -![Release](https://img.shields.io/github/v/tag/gofiber/template?filter=django*) +![Release](https://img.shields.io/github/v/tag/gofiber/template?filter=handlebars*) [![Discord](https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7)](https://gofiber.io/discord) ![Test](https://github.com/gofiber/template/workflows/Tests/badge.svg) ![Security](https://github.com/gofiber/template/workflows/Security/badge.svg) diff --git a/template_versioned_docs/version-pug_v2.x.x/html/README.md b/template_versioned_docs/version-pug_v2.x.x/html/README.md index e4e65d5f61b..88f159b2f90 100644 --- a/template_versioned_docs/version-pug_v2.x.x/html/README.md +++ b/template_versioned_docs/version-pug_v2.x.x/html/README.md @@ -3,7 +3,7 @@ id: html title: HTML --- -![Release](https://img.shields.io/github/v/tag/gofiber/template?filter=django*) +![Release](https://img.shields.io/github/v/tag/gofiber/template?filter=html*) [![Discord](https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7)](https://gofiber.io/discord) ![Test](https://github.com/gofiber/template/workflows/Tests/badge.svg) ![Security](https://github.com/gofiber/template/workflows/Security/badge.svg) @@ -93,6 +93,13 @@ func main() { }, "layouts/main") }) + app.Get("/layouts-nested", func(c *fiber.Ctx) error { + // Render index within layouts/nested/main within layouts/nested/base + return c.Render("index", fiber.Map{ + "Title": "Hello, World!", + }, "layouts/nested/main", "layouts/nested/base") + }) + log.Fatal(app.Listen(":3000")) } diff --git a/template_versioned_docs/version-pug_v2.x.x/jet/README.md b/template_versioned_docs/version-pug_v2.x.x/jet/README.md index bffdd78272b..b9f081b9378 100644 --- a/template_versioned_docs/version-pug_v2.x.x/jet/README.md +++ b/template_versioned_docs/version-pug_v2.x.x/jet/README.md @@ -3,7 +3,7 @@ id: jet title: Jet --- -![Release](https://img.shields.io/github/v/tag/gofiber/template?filter=django*) +![Release](https://img.shields.io/github/v/tag/gofiber/template?filter=jet*) [![Discord](https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7)](https://gofiber.io/discord) ![Test](https://github.com/gofiber/template/workflows/Tests/badge.svg) ![Security](https://github.com/gofiber/template/workflows/Security/badge.svg) diff --git a/template_versioned_docs/version-pug_v2.x.x/mustache/README.md b/template_versioned_docs/version-pug_v2.x.x/mustache/README.md index 6c02c01ed6a..a7e94e97537 100644 --- a/template_versioned_docs/version-pug_v2.x.x/mustache/README.md +++ b/template_versioned_docs/version-pug_v2.x.x/mustache/README.md @@ -3,7 +3,7 @@ id: mustache title: Mustache --- -![Release](https://img.shields.io/github/v/tag/gofiber/template?filter=django*) +![Release](https://img.shields.io/github/v/tag/gofiber/template?filter=mustache*) [![Discord](https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7)](https://gofiber.io/discord) ![Test](https://github.com/gofiber/template/workflows/Tests/badge.svg) ![Security](https://github.com/gofiber/template/workflows/Security/badge.svg) diff --git a/template_versioned_docs/version-pug_v2.x.x/pug/README.md b/template_versioned_docs/version-pug_v2.x.x/pug/README.md index b4bd57fb6a6..0cc729fec1d 100644 --- a/template_versioned_docs/version-pug_v2.x.x/pug/README.md +++ b/template_versioned_docs/version-pug_v2.x.x/pug/README.md @@ -3,7 +3,7 @@ id: pug title: Pug --- -![Release](https://img.shields.io/github/v/tag/gofiber/template?filter=django*) +![Release](https://img.shields.io/github/v/tag/gofiber/template?filter=pug*) [![Discord](https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7)](https://gofiber.io/discord) ![Test](https://github.com/gofiber/template/workflows/Tests/badge.svg) ![Security](https://github.com/gofiber/template/workflows/Security/badge.svg) @@ -58,7 +58,7 @@ func main() { // Or from an embedded system // See github.com/gofiber/embed for examples - // engine := pug.NewFileSystem(http.Dir("./views", ".pug")) + // engine := pug.NewFileSystem(http.Dir("./views"), ".pug") // Pass the engine to the views app := fiber.New(fiber.Config{ diff --git a/template_versioned_docs/version-pug_v2.x.x/slim/README.md b/template_versioned_docs/version-pug_v2.x.x/slim/README.md index 5e92de4a4e3..63b7bc82793 100644 --- a/template_versioned_docs/version-pug_v2.x.x/slim/README.md +++ b/template_versioned_docs/version-pug_v2.x.x/slim/README.md @@ -3,7 +3,7 @@ id: slim title: Slim --- -![Release](https://img.shields.io/github/v/tag/gofiber/template?filter=django*) +![Release](https://img.shields.io/github/v/tag/gofiber/template?filter=slim*) [![Discord](https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7)](https://gofiber.io/discord) ![Test](https://github.com/gofiber/template/workflows/Tests/badge.svg) ![Security](https://github.com/gofiber/template/workflows/Security/badge.svg)