{"id":13806387,"url":"https://github.com/gofiber/template","last_synced_at":"2026-04-22T12:01:37.146Z","repository":{"id":37880533,"uuid":"240407862","full_name":"gofiber/template","owner":"gofiber","description":"🧬 Template engine middleware for Fiber","archived":false,"fork":false,"pushed_at":"2026-04-17T14:01:39.000Z","size":1503,"stargazers_count":312,"open_issues_count":23,"forks_count":59,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-04-17T14:13:33.484Z","etag":null,"topics":["fiber","middleware","template","template-engine"],"latest_commit_sha":null,"homepage":"https://docs.gofiber.io/guide/templates","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gofiber.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-02-14T01:58:52.000Z","updated_at":"2026-04-17T14:01:42.000Z","dependencies_parsed_at":"2023-11-15T03:26:58.221Z","dependency_job_id":"932d9231-e5f1-473f-8adf-3246260c3cf8","html_url":"https://github.com/gofiber/template","commit_stats":{"total_commits":556,"total_committers":41,"mean_commits":"13.560975609756097","dds":0.7032374100719425,"last_synced_commit":"fc0eea410cdfa4f11c25243bf231269ce90d14d2"},"previous_names":["gofiber/templates"],"tags_count":199,"template":false,"template_full_name":null,"purl":"pkg:github/gofiber/template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gofiber%2Ftemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gofiber%2Ftemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gofiber%2Ftemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gofiber%2Ftemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gofiber","download_url":"https://codeload.github.com/gofiber/template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gofiber%2Ftemplate/sbom","scorecard":{"id":433754,"data":{"date":"2025-08-11","repo":{"name":"github.com/gofiber/template","commit":"7fc667a7d50419375747f18f75e82ab68e8754e4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.8,"checks":[{"name":"Code-Review","score":1,"reason":"Found 1/8 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":10,"reason":"23 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":1,"reason":"dependency not pinned by hash detected -- score normalized to 1","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/auto-labeler.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/auto-labeler.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/benchmark.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/benchmark.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/benchmark.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/benchmark.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/benchmark.yml:49: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/benchmark.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/benchmark.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/benchmark.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/dependabot_automerge.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/dependabot_automerge.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/dependabot_automerge.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/dependabot_automerge.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/golangci-lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/golangci-lint.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/golangci-lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gosec.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/gosec.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/gosec.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/gosec.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gosec.yml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/gosec.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gosec.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/gosec.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/govulncheck.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/govulncheck.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/govulncheck.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/govulncheck.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-drafter.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/release-drafter.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-drafter.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/release-drafter.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-drafter.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/release-drafter.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/sync-docs.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/sync-docs.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/sync-docs.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/sync-docs.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-ace.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-ace.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-ace.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-ace.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-amber.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-amber.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-amber.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-amber.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-django.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-django.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-django.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-django.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-handlebars.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-handlebars.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-handlebars.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-handlebars.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-html.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-html.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-html.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-html.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-jet.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-jet.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-jet.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-jet.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-mustache.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-mustache.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-mustache.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-mustache.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-pug.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-pug.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-pug.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-pug.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-slim.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-slim.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-slim.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/gofiber/template/test-slim.yml/master?enable=pin","Warn: goCommand not pinned by hash: .github/workflows/gosec.yml:63","Warn: goCommand not pinned by hash: .github/workflows/govulncheck.yml:38","Info:   0 out of  32 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   8 third-party GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned","Info:   0 out of   2 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'pull-requests' permission set to 'read': .github/workflows/release-drafter.yml:13","Warn: topLevel 'statuses' permission set to 'write': .github/workflows/auto-labeler.yml:11","Warn: topLevel 'checks' permission set to 'write': .github/workflows/auto-labeler.yml:12","Info: topLevel 'contents' permission set to 'read': .github/workflows/auto-labeler.yml:8","Warn: topLevel 'deployments' permission set to 'write': .github/workflows/benchmark.yml:21","Warn: topLevel 'contents' permission set to 'write': .github/workflows/benchmark.yml:22","Warn: topLevel 'contents' permission set to 'write': .github/workflows/dependabot_automerge.yml:7","Info: topLevel 'contents' permission set to 'read': .github/workflows/golangci-lint.yml:23","Info: topLevel 'pull-requests' permission set to 'read': .github/workflows/golangci-lint.yml:24","Warn: topLevel 'checks' permission set to 'write': .github/workflows/golangci-lint.yml:25","Warn: no topLevel permission defined: .github/workflows/gosec.yml:1","Warn: no topLevel permission defined: .github/workflows/govulncheck.yml:1","Warn: no topLevel permission defined: .github/workflows/release-drafter.yml:1","Warn: no topLevel permission defined: .github/workflows/sync-docs.yml:1","Warn: no topLevel permission defined: .github/workflows/test-ace.yml:1","Warn: no topLevel permission defined: .github/workflows/test-amber.yml:1","Warn: no topLevel permission defined: .github/workflows/test-django.yml:1","Warn: no topLevel permission defined: .github/workflows/test-handlebars.yml:1","Warn: no topLevel permission defined: .github/workflows/test-html.yml:1","Warn: no topLevel permission defined: .github/workflows/test-jet.yml:1","Warn: no topLevel permission defined: .github/workflows/test-mustache.yml:1","Warn: no topLevel permission defined: .github/workflows/test-pug.yml:1","Warn: no topLevel permission defined: .github/workflows/test-slim.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T04:04:39.355Z","repository_id":37880533,"created_at":"2025-08-19T04:04:39.356Z","updated_at":"2025-08-19T04:04:39.356Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32135189,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T08:34:57.708Z","status":"ssl_error","status_checked_at":"2026-04-22T08:34:55.583Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fiber","middleware","template","template-engine"],"created_at":"2024-08-04T01:01:11.179Z","updated_at":"2026-04-22T12:01:32.119Z","avatar_url":"https://github.com/gofiber.png","language":"Go","readme":"---\ntitle: 👋 Welcome\ndescription: 🧬 Template engine middlewares for Fiber.\nsidebar_position: 1\n---\n\n\n\u003cp align=\"center\"\u003e\n  \u003cimg height=\"125\" alt=\"Fiber\" src=\"https://raw.githubusercontent.com/gofiber/template/master/.github/logo-dark.svg#gh-dark-mode-only\"/\u003e\n  \u003cimg height=\"125\" alt=\"Fiber\" src=\"https://raw.githubusercontent.com/gofiber/template/master/.github/logo.svg#gh-light-mode-only\" /\u003e\n  \u003cbr/\u003e\n\n  \u003ca href=\"https://pkg.go.dev/github.com/gofiber/template/v2?tab=doc\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/%F0%9F%93%9A%20godoc-pkg-00ACD7.svg?color=00ACD7\u0026style=flat\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/gofiber/template\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/%F0%9F%93%9D%20goreport-A%2B-75C46B\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://gofiber.io/discord\"\u003e\n    \u003cimg src=\"https://img.shields.io/discord/704680098577514527?style=flat\u0026label=%F0%9F%92%AC%20discord\u0026color=00ACD7\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nThis package provides universal methods to use multiple template engines with the [Fiber web framework](https://github.com/gofiber/fiber) using the new [Views](https://godoc.org/github.com/gofiber/fiber#Views) interface that is available from `\u003e v1.11.1`. Special thanks to @bdtomlin \u0026 @arsmn for helping!\n\n9 template engines are supported:\n- [ace](./ace/README.md) \u003ca href=\"https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Ace%22\"\u003e \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/gofiber/template/test-ace.yml?branch=master\u0026label=%F0%9F%A7%AA%20\u0026style=flat\u0026color=75C46B\"/\u003e\u003c/a\u003e \n- [amber](./amber/README.md) \u003ca href=\"https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Amber%22\"\u003e \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/gofiber/template/test-amber.yml?branch=master\u0026label=%F0%9F%A7%AA%20\u0026style=flat\u0026color=75C46B\"/\u003e\u003c/a\u003e\n- [django](./django/README.md) \u003ca href=\"https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Django%22\"\u003e \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/gofiber/template/test-django.yml?branch=master\u0026label=%F0%9F%A7%AA%20\u0026style=flat\u0026color=75C46B\"/\u003e\u003c/a\u003e \n- [handlebars](./handlebars/README.md) \u003ca href=\"https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Handlebars%22\"\u003e \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/gofiber/template/test-handlebars.yml?branch=master\u0026label=%F0%9F%A7%AA%20\u0026style=flat\u0026color=75C46B\"/\u003e\u003c/a\u003e\n- [html](./html/README.md) \u003ca href=\"https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Html%22\"\u003e \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/gofiber/template/test-html.yml?branch=master\u0026label=%F0%9F%A7%AA%20\u0026style=flat\u0026color=75C46B\"/\u003e \u003c/a\u003e\n- [jet](./jet/README.md) \u003ca href=\"https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Jet%22\"\u003e \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/gofiber/template/test-jet.yml?branch=master\u0026label=%F0%9F%A7%AA%20\u0026style=flat\u0026color=75C46B\"/\u003e\u003c/a\u003e\n- [mustache](./mustache/README.md) \u003ca href=\"https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Mustache%22\"\u003e \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/gofiber/template/test-mustache.yml?branch=master\u0026label=%F0%9F%A7%AA%20\u0026style=flat\u0026color=75C46B\"/\u003e\u003c/a\u003e\n- [pug](./pug/README.md) \u003ca href=\"https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Pug%22\"\u003e \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/gofiber/template/test-pug.yml?branch=master\u0026label=%F0%9F%A7%AA%20\u0026style=flat\u0026color=75C46B\"/\u003e\u003c/a\u003e\n- [slim](./slim/README.md) \u003ca href=\"https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Slim%22\"\u003e \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/gofiber/template/test-slim.yml?branch=master\u0026label=%F0%9F%A7%AA%20\u0026style=flat\u0026color=75C46B\"/\u003e\u003c/a\u003e\n\n### Installation\nGo version support: We only support the latest two versions of Go. Visit https://go.dev/doc/devel/release for more information.\n\n```\ngo get -u github.com/gofiber/fiber/v3\ngo get -u github.com/gofiber/template/any_template_engine/vX\n```\n\n### Example\n```go\npackage main\n\nimport (\n\t\"log\"\n\n        \"github.com/gofiber/fiber/v3\"\n\n\t// To use a specific template engine, import as shown below:\n\t// \"github.com/gofiber/template/pug/v3\"\n\t// \"github.com/gofiber/template/mustache/v3\"\n\t// etc..\n\n\t// In this example we use the html template engine\n\t\"github.com/gofiber/template/html/v3\"\n)\n\nfunc main() {\n\t// Create a new engine by passing the template folder\n\t// and template extension using \u003cengine\u003e.New(dir, ext string)\n\tengine := html.New(\"./views\", \".html\")\n\n  \t// We also support the http.FileSystem interface\n\t// See examples below to load templates from embedded files\n\tengine := html.NewFileSystem(http.Dir(\"./views\"), \".html\")\n\n\t// Reload the templates on each render, good for development\n\tengine.Reload(true) // Optional. Default: false\n\n\t// Debug will print each template that is parsed, good for debugging\n\tengine.Debug(true) // Optional. Default: false\n\n\t// Layout defines the variable name that is used to yield templates within layouts\n\tengine.Layout(\"embed\") // Optional. Default: \"embed\"\n\n\t// Delims sets the action delimiters to the specified strings\n\tengine.Delims(\"{{\", \"}}\") // Optional. Default: engine delimiters\n\n\t// AddFunc adds a function to the template's global function map.\n\tengine.AddFunc(\"greet\", func(name string) string {\n\t\treturn \"Hello, \" + name + \"!\"\n\t})\n\n\t// After you created your engine, you can pass it to Fiber's Views Engine\n\tapp := fiber.New(fiber.Config{\n\t\tViews: engine,\n\t})\n\n\t// To render a template, you can call the ctx.Render function\n\t// Render(tmpl string, values interface{}, layout ...string)\n\tapp.Get(\"/\", func(c fiber.Ctx) error {\n\t\treturn c.Render(\"index\", fiber.Map{\n\t\t\t\"Title\": \"Hello, World!\",\n\t\t})\n\t})\n\n\t// Render with layout example\n\tapp.Get(\"/layout\", func(c fiber.Ctx) error {\n\t\treturn c.Render(\"index\", fiber.Map{\n\t\t\t\"Title\": \"Hello, World!\",\n\t\t}, \"layouts/main\")\n\t})\n\n\tlog.Fatal(app.Listen(\":3000\"))\n}\n\n```\n\n### More Examples\n\nTo view more specific examples, you could visit each engine folder to learn more\n- [ace](./ace/README.md)\n- [amber](./amber/README.md)\n- [django](./django/README.md)\n- [handlebars](./handlebars/README.md)\n- [html](./html/README.md)\n- [jet](./jet/README.md)\n- [mustache](./mustache/README.md)\n- [pug](./pug/README.md)\n- [slim](./slim/README.md)\n\n\n### embedded Systems\n\nWe support the `http.FileSystem` interface, so you can use different libraries to load the templates from embedded binaries.\n\n#### pkger\nRead documentation: https://github.com/markbates/pkger\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\n        \"github.com/gofiber/fiber/v3\"\n\t\"github.com/gofiber/template/html/v3\"\n\n\t\"github.com/markbates/pkger\"\n)\n\nfunc main() {\n\tengine := html.NewFileSystem(pkger.Dir(\"/views\"), \".html\")\n\n\tapp := fiber.New(fiber.Config{\n\t\tViews: engine,\n\t})\n\n\t// run pkger \u0026\u0026 go build\n}\n```\n#### packr\nRead documentation: https://github.com/gobuffalo/packr\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\n        \"github.com/gofiber/fiber/v3\"\n\t\"github.com/gofiber/template/html/v3\"\n\n\t\"github.com/gobuffalo/packr/v2\"\n)\n\nfunc main() {\n\tengine := html.NewFileSystem(packr.New(\"Templates\", \"/views\"), \".html\")\n\n\tapp := fiber.New(fiber.Config{\n\t\tViews: engine,\n\t})\n\n\t// run packr \u0026\u0026 go build\n}\n```\n#### go.rice\nRead documentation: https://github.com/GeertJohan/go.rice\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\n        \"github.com/gofiber/fiber/v3\"\n\t\"github.com/gofiber/template/html/v3\"\n\n\t\"github.com/GeertJohan/go.rice\"\n)\n\nfunc main() {\n\tengine := html.NewFileSystem(rice.MustFindBox(\"views\").HTTPBox(), \".html\")\n\n\tapp := fiber.New(fiber.Config{\n\t\tViews: engine,\n\t})\n\n\t// run rice embed-go \u0026\u0026 go build\n}\n\n```\n#### fileb0x\nRead documentation: https://github.com/UnnoTed/fileb0x\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\n\t\"github.com/gofiber/fiber/v3\"\n\t\"github.com/gofiber/template/html/v3\"\n\t// your generated package\n\t\"github.com/\u003cuser\u003e/\u003crepo\u003e/static\"\n)\n\nfunc main() {\n\tengine := html.NewFileSystem(static.HTTP, \".html\")\n\n\tapp := fiber.New(fiber.Config{\n\t\tViews: engine,\n\t})\n\n\t// Read the documentation on how to use fileb0x\n}\n```\n\n\n### Benchmarks\n\nSee the benchmarks under https://gofiber.github.io/template/benchmarks\n\n#### Simple\n![](https://raw.githubusercontent.com/gofiber/template/master/.github/data/Simple-TimeperOperation.png)\n\n#### Extended\n![](https://raw.githubusercontent.com/gofiber/template/master/.github/data/Extended-TimeperOperation.png)\n\nBenchmarks were ran on Apple Macbook M1. Each engine was benchmarked 20 times and the results averaged into a single xlsx file. Mustache was excluded from the extended benchmark\n","funding_links":[],"categories":["⚙️ Middlewares"],"sub_categories":["🔗 External"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgofiber%2Ftemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgofiber%2Ftemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgofiber%2Ftemplate/lists"}