{"id":15096005,"url":"https://github.com/reddec/gin-template-manager","last_synced_at":"2026-01-06T17:13:43.543Z","repository":{"id":57692059,"uuid":"481985069","full_name":"reddec/gin-template-manager","owner":"reddec","description":"Manages Golang templates and integrates with Gin framework","archived":false,"fork":false,"pushed_at":"2022-04-20T14:04:14.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T03:34:34.545Z","etag":null,"topics":["gin-contrib","gin-gonic","go-template","golang","views"],"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/reddec.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}},"created_at":"2022-04-15T14:29:45.000Z","updated_at":"2022-04-16T13:08:24.000Z","dependencies_parsed_at":"2022-08-27T19:00:35.128Z","dependency_job_id":null,"html_url":"https://github.com/reddec/gin-template-manager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fgin-template-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fgin-template-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fgin-template-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fgin-template-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reddec","download_url":"https://codeload.github.com/reddec/gin-template-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245852708,"owners_count":20683081,"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":["gin-contrib","gin-gonic","go-template","golang","views"],"created_at":"2024-09-25T15:44:48.360Z","updated_at":"2026-01-06T17:13:43.483Z","avatar_url":"https://github.com/reddec.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gin template manager\n\nManages Golang templates and integrates with Gin framework.\n\nFeatures:\n\n- Layouts, including nested ('base', 'sub-base', 'sub-sub-base', ...)\n- Caching\n- Streaming\n- Supports embedded assets\n- Supports named routes with parameters (ex: `.Ref \"eventByID\" 1234` could be mapped to `../events/1234` with proper escaping)\n\nCheck [example](example) directory.\n\nThe project is focusing on developer experience (DX) rather on the performance.\n\nGoals are:\n\n- make developing SSR applications on Go convenient and simple\n- extend and integrate (not replace) with Gin framework\n- keep it flexible\n\nInspirations: Hugo, Django, Rails\n\n**STATUS:** proof-of-concept\n\n## Usage\n\n**Initialize manager**\n\n* Opt: filesystem: `templates := mananger.New(os.DirFS(\"path-to-dir\"))`\n* Opt: assets (embedded): `templates := mananger.New(assets)`\n\n**Link to Gin router**\n\n* `router.HTMLRender = templates`\n\n**Render**\n\n* `gctx.HTML(http.StatusOK, \"index.html\", \"params\")`\n\n### Example\n\n```go\ntemplates := mananger.New(os.DirFS(\"path-to-dir\"))\n\nrouter := gin.Default()\nrouter.HTMLRender = templates\n\nrouter.GET(\"/\", func(gctx *gin.Context) {\n    gctx.HTML(http.StatusOK, \"index.html\", \"params\")\n})\n// ...\n```\n\n## Convention\n\nDirectory structure\n\n* `@layout.html` - layout file","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freddec%2Fgin-template-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freddec%2Fgin-template-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freddec%2Fgin-template-manager/lists"}