We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I really love to see that Fiber is supporting Pug for templates.
Just fiddling around but I can't get a simple example to work.
Title is working, the conditional not.
Rendering in handler:
app.Get("/hello", func(c *fiber.Ctx) error { return c.Render("hello", fiber.Map{ "Title": "Hello from Fiber with Pug!", "LoggedIn": true, }) })
Getting the following warning: 2024/08/29 23:47:08.480286 app.go:999: [Warn] failed to load views: template: hello:2: unexpected "#" in if
2024/08/29 23:47:08.480286 app.go:999: [Warn] failed to load views: template: hello:2: unexpected "#" in if
h1.title #{ .Title } if #{ .LoggedIn } p Hello User! else p Hello Stranger!
The text was updated successfully, but these errors were encountered:
This one is also not working:
- var loggedIn = #{ .LoggedIn } h1.title #{ .Title } if loggedIn p Hello User! else p Hello Stranger!
Sorry, something went wrong.
Sometimes it is simpler than expected:
h1.title #{ .Title } if .LoggedIn p Hello User! else p Hello Stranger!
Maybe a short example can be added to the documentation?
Sometimes it is simpler than expected: h1.title #{ .Title } if .LoggedIn p Hello User! else p Hello Stranger! Maybe a short example can be added to the documentation?
Sure, you can create a PR to demonstrate Pug syntax and behavior in docs
No branches or pull requests
Question Description
I really love to see that Fiber is supporting Pug for templates.
Just fiddling around but I can't get a simple example to work.
Title is working, the conditional not.
Rendering in handler:
Getting the following warning:
2024/08/29 23:47:08.480286 app.go:999: [Warn] failed to load views: template: hello:2: unexpected "#" in if
Code Snippet (optional)
Checklist:
The text was updated successfully, but these errors were encountered: