{"id":19163677,"url":"https://github.com/stnc/mypongoginrender","last_synced_at":"2026-06-30T13:31:11.962Z","repository":{"id":69123039,"uuid":"393297602","full_name":"stnc/myPongoGinRender","owner":"stnc","description":"Compatible with pongo version 4 - for gin framework","archived":false,"fork":false,"pushed_at":"2022-03-08T07:22:30.000Z","size":206,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-03T21:45:15.585Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/stnc.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-06T07:42:29.000Z","updated_at":"2023-11-09T07:34:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"3a3226a8-6403-4795-af47-e1d791fe9907","html_url":"https://github.com/stnc/myPongoGinRender","commit_stats":null,"previous_names":["stnc/pongo4gin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stnc%2FmyPongoGinRender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stnc%2FmyPongoGinRender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stnc%2FmyPongoGinRender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stnc%2FmyPongoGinRender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stnc","download_url":"https://codeload.github.com/stnc/myPongoGinRender/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240245887,"owners_count":19771029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-09T09:16:19.495Z","updated_at":"2026-06-17T15:30:18.721Z","avatar_url":"https://github.com/stnc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"my Pongo Gin Render\n\n=========\n\nPackage myPongoGinRender is a template renderer that can be used with the Gin web\nframework https://github.com/gin-gonic/gin it uses the Pongo2 template library\nhttps://github.com/flosch/pongo2\n\nCompatible with pongo version 4\n\npongo2 is a Django-syntax like templating-language (official website).\n\nI just made it for my own use. Not commercial use \n\n\u003cstrong\u003eOrginal Code By Andrejs Cainikovs - Rob van der Linde (https://gitlab.com/go-box/pongo2gin) \u003c/strong\u003e\n\n## Here is Compatible with pongo version 4 \u0026  version 5\n\n [pongo2 version 1](https://github.com/stnc/myPongoGinRender/) - pongo2 gin minimal framework stability renderer / Compatible with pongo version 2 \n \n \n [pongo2 version 4](https://github.com/stnc/myPongoGinRender/tree/main/v4) -  Compatible with pongo version 4\n \n \n [pongo2 version 5](https://github.com/stnc/myPongoGinRender/tree/main/v5) -  Compatible with pongo version 5\n\n# please don't forget to give stars :)\n\n## Installation  \n\n`go get \"github.com/stnc/myPongoGinRender\"`\n\nRequirements\n------------\n\nRequires Gin 1.14 or higher and Pongo2.\n\nUsage\n-----\n\nTo use myPongoGinRender you need to set your router.HTMLRenderer to a new renderer\ninstance, this is done after creating the Gin router when the Gin application\nstarts up. This assumes templates will be located in the \"templates\"\ndirectory, or you can use myPongoGinRender.TemplatePath(\"templates\") to specify a custom location.\n\nTo render templates from a route, call c.HTML just as you would with\nregular Gin templates, the only difference is that you pass template\ndata as a pongo2.Context instead of gin.H type.\n\n\n![Screen](https://raw.githubusercontent.com/stnc/myPongoGinRender/master/example/ginScreen.png)\n\nBasic Example\n-------------\n\n```go\n\npackage main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\t\"github.com/stnc/myPongoGinRender\"\n\t\"github.com/flosch/pongo2\"\n\t\"github.com/gin-gonic/gin\"\n)\n\n//GetAllData all list\nfunc GetAllData(c *gin.Context) {\n\tposts := []string{\n\t\t\"Larry Ellison\",\n\t\t\"Carlos Slim Helu\",\n\t\t\"Mark Zuckerberg\",\n\t\t\"Amancio Ortega \",\n\t\t\"Jeff Bezos\",\n\t\t\" Warren Buffet \",\n\t\t\"Bill Gates\",\n\t\t\"selman tunç\",\n\t}\n\t// Call the HTML method of the Context to render a template\n\tc.HTML(http.StatusOK, \"index.html\",\n\t\tpongo2.Context{\n\t\t\t\"title\": \"hello pongo\",\n\t\t\t\"posts\": posts,\n\t\t},\n\t)\n}\n\nfunc main() {\n\n\tgin.SetMode(gin.DebugMode)\n\tr := gin.Default()\n\tr.Use(gin.Recovery())\n\tr.HTMLRender = myPongoGinRender.TemplatePath(\"templates\")\n\tr.GET(\"/\", GetAllData)\n\tlog.Fatal(r.Run(\":8888\"))\n}\n\n```\n\nHTML \n----------------\n\n\n```html\n\n\u003ch1\u003e {{ title }}\u003c/h1\u003e\n\n{% for post in posts%}\n\u003cul\u003e\n  \u003cli\u003e{{post}}\u003c/li\u003e\n\u003c/ul\u003e\n{% endfor %}\n\n```\n\nTemplate Caching\n----------------\n\nTemplates will be cached if the current Gin Mode is set to anything but \"debug\",\nthis means the first time a template is used it will still load from disk, but\nafter that the cached template will be used from memory instead.\n\nIf he Gin Mode is set to \"debug\" then templates will be loaded from disk on\neach request.\n\nCaching is implemented by the Pongo2 library itself.\n\nGoDoc\n-----\n\n\nSpecials Thanks\n-----\nhttps://gitlab.com/go-box/pongo2gin\n\nhttps://zhuanlan.zhihu.com/p/105956154  \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstnc%2Fmypongoginrender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstnc%2Fmypongoginrender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstnc%2Fmypongoginrender/lists"}