Skip to content

Commit

Permalink
fix template markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneWerner87 committed Aug 30, 2024
1 parent 4b1ee0b commit 9541a88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ coverage:
format:
go run mvdan.cc/gofumpt@latest -w -l .

## format: 🎨 Find markdown format issues (Requires markdownlint-cli)
## markdown: 🎨 Find markdown format issues (Requires markdownlint-cli)
.PHONY: markdown
markdown:
markdownlint-cli2 "**/*.md" "#vendor"
Expand Down Expand Up @@ -57,7 +57,7 @@ tidy:
betteralign:
go run github.com/dkorunic/betteralign/cmd/betteralign@latest -test_files -generated_files -apply ./...

## tidy: ⚡️ Generate msgp && interface implementations
## generate: ⚡️ Generate msgp && interface implementations
.PHONY: generate
generate:
go install github.com/tinylib/msgp@latest
Expand Down
7 changes: 1 addition & 6 deletions docs/guide/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ app := fiber.New(fiber.Config{
})
```


### Supported Engines

The Fiber team maintains a [templates](https://docs.gofiber.io/template) package that provides wrappers for multiple template engines:
Expand All @@ -47,7 +46,6 @@ The Fiber team maintains a [templates](https://docs.gofiber.io/template) package
Custom template engines can implement the `Views` interface to be supported in Fiber.
:::


```go title="Views interface"
type Views interface {
// Fiber executes Load() on app initialization to load/parse the templates
Expand All @@ -63,7 +61,6 @@ type Views interface {
The `Render` method is linked to the [**ctx.Render\(\)**](../api/ctx.md#render) function that accepts a template name and binding data.
:::


## Rendering Templates

Once an engine is set up, a route handler can call the [**ctx.Render\(\)**](../api/ctx.md#render) function with a template name and binded data to send the rendered template.
Expand All @@ -76,9 +73,7 @@ func (c Ctx) Render(name string, bind Map, layouts ...string) error
By default, [**ctx.Render\(\)**](../api/ctx.md#render) searches for the template name in the `ViewsLayout` path. To override this setting, provide the path(s) in the `layouts` argument.
:::


<Tabs>

<TabItem value="example" label="Example">

```go
Expand Down Expand Up @@ -211,7 +206,7 @@ app.Get("/", func (c fiber.Ctx) error {
</TabItem>
</Tabs>

- For more advanced template documentation, please visit the [gofiber/template GitHub Repository](https://github.com/gofiber/template).
* For more advanced template documentation, please visit the [gofiber/template GitHub Repository](https://github.com/gofiber/template).

## Full Example

Expand Down

1 comment on commit 9541a88

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: 9541a88 Previous: 87bb93e Ratio
Benchmark_Ctx_Fresh_WithNoCache 144.7 ns/op 0 B/op 0 allocs/op 92.92 ns/op 0 B/op 0 allocs/op 1.56
Benchmark_Ctx_Fresh_WithNoCache - ns/op 144.7 ns/op 92.92 ns/op 1.56
Benchmark_Ctx_IP_With_ProxyHeader 50.64 ns/op 0 B/op 0 allocs/op 32.39 ns/op 0 B/op 0 allocs/op 1.56
Benchmark_Ctx_IP_With_ProxyHeader - ns/op 50.64 ns/op 32.39 ns/op 1.56
Benchmark_Ctx_Send 7.36 ns/op 0 B/op 0 allocs/op 4.661 ns/op 0 B/op 0 allocs/op 1.58
Benchmark_Ctx_Send - ns/op 7.36 ns/op 4.661 ns/op 1.58
Benchmark_Utils_GetOffer/1_parameter 215.3 ns/op 0 B/op 0 allocs/op 136.1 ns/op 0 B/op 0 allocs/op 1.58
Benchmark_Utils_GetOffer/1_parameter - ns/op 215.3 ns/op 136.1 ns/op 1.58
Benchmark_Middleware_BasicAuth - B/op 80 B/op 48 B/op 1.67
Benchmark_Middleware_BasicAuth - allocs/op 5 allocs/op 3 allocs/op 1.67
Benchmark_Middleware_BasicAuth_Upper - B/op 80 B/op 48 B/op 1.67
Benchmark_Middleware_BasicAuth_Upper - allocs/op 5 allocs/op 3 allocs/op 1.67
Benchmark_CORS_NewHandler - B/op 16 B/op 0 B/op +∞
Benchmark_CORS_NewHandler - allocs/op 1 allocs/op 0 allocs/op +∞
Benchmark_CORS_NewHandlerSingleOrigin - B/op 16 B/op 0 B/op +∞
Benchmark_CORS_NewHandlerSingleOrigin - allocs/op 1 allocs/op 0 allocs/op +∞
Benchmark_CORS_NewHandlerPreflight - B/op 104 B/op 0 B/op +∞
Benchmark_CORS_NewHandlerPreflight - allocs/op 5 allocs/op 0 allocs/op +∞
Benchmark_CORS_NewHandlerPreflightSingleOrigin - B/op 104 B/op 0 B/op +∞
Benchmark_CORS_NewHandlerPreflightSingleOrigin - allocs/op 5 allocs/op 0 allocs/op +∞
Benchmark_CORS_NewHandlerPreflightWildcard - B/op 104 B/op 0 B/op +∞
Benchmark_CORS_NewHandlerPreflightWildcard - allocs/op 5 allocs/op 0 allocs/op +∞
Benchmark_Middleware_CSRF_GenerateToken - B/op 521 B/op 326 B/op 1.60
Benchmark_Middleware_CSRF_GenerateToken - allocs/op 10 allocs/op 6 allocs/op 1.67

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.