{"id":19228937,"url":"https://github.com/heppu/embdr","last_synced_at":"2026-06-14T16:36:16.540Z","repository":{"id":57520396,"uuid":"235949107","full_name":"heppu/embdr","owner":"heppu","description":"Go template embedding tool","archived":false,"fork":false,"pushed_at":"2020-03-28T14:28:06.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-29T15:39:00.277Z","etag":null,"topics":["build-tool","code-generator","embedded","go","golang","html-template","static-assets","templates"],"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/heppu.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":"2020-01-24T06:08:20.000Z","updated_at":"2025-03-07T12:23:41.000Z","dependencies_parsed_at":"2022-09-26T18:00:52.501Z","dependency_job_id":null,"html_url":"https://github.com/heppu/embdr","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/heppu/embdr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heppu%2Fembdr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heppu%2Fembdr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heppu%2Fembdr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heppu%2Fembdr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heppu","download_url":"https://codeload.github.com/heppu/embdr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heppu%2Fembdr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34327926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["build-tool","code-generator","embedded","go","golang","html-template","static-assets","templates"],"created_at":"2024-11-09T15:31:08.289Z","updated_at":"2026-06-14T16:36:16.512Z","avatar_url":"https://github.com/heppu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Embdr\n[![Documentation](https://godoc.org/github.com/heppu/embdr?status.svg)](https://pkg.go.dev//github.com/heppu/embdr)\n[![Go Report Card](https://goreportcard.com/badge/github.com/heppu/embdr)](https://goreportcard.com/report/github.com/heppu/embdr)\n[![codecov](https://codecov.io/gh/heppu/embdr/branch/master/graph/badge.svg)](https://codecov.io/gh/heppu/embdr)\n[![Release](https://img.shields.io/github/release/heppu/embdr.svg?label=Release)](https://github.com/heppu/embdr/releases)\n[![GitHub issues](https://img.shields.io/github/issues/heppu/embdr.svg)](https://github.com/heppu/embdr/issues)\n[![license](https://img.shields.io/github/license/heppu/embdr.svg?maxAge=2592000)](https://github.com/heppu/embdr/LICENSE)\n\n\nEmdeb Go templates with zero 3rd party dependencies.\n\nJust generate and load.\n\nGenerate:\n```\nembdr -p mypkg -o templates.go index.tmpl`\n```\n\nLoad:\n```go\ntmpl, err := LoadTemplate(\"index.tmpl\")\n```\n\n## Install\n\ngo get github.com/heppu/embdr/cmd/embdr\n\n## Usage\n\n\n```\nembdr -p \u003cpackage_name\u003e [-o output_file] [file_1 file_2 ...]\n\nFlags:\n\n\t-p  package name\n\t-o  output file (default STDOUT)\n```\n\n### Embed single file\n\n```bash\nembdr -p mypkg -o templates.go index.tmpl\n```\n\n### Embed all files from folder\n\n```bash\nfind ./templates/ -name '*.tmpl' | ./embdr -p mypkg -o templates.go\n```\n\n### Using go generate directive\n\nDefine template file.\n\n```\n{{- /* user.tmpl */ -}}\n\nHi there {{.Name}}!\n```\n\nThen create file that has the //go:generate directive.\n\n```go\n// main.go\n\npackage main\n\n//go:generate embdr -p main -o templates.go user.tmpl\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"text/template\"\n)\n\ntype User struct {\n\tName string\n}\n\nfunc main() {\n\tconst name = \"user.tmpl\"\n\n\tdata, err := LoadTemplate(name)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tt, err := template.New(name).Parse(data)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\terr = t.Execute(os.Stdout, User{Name: \"Gopher\"})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\nNow just generate embedded templates with go generate and you are ready to go!\n\n```bash\n$ go generate ./...\n$ go run main.go templates.go\nHi there Gopher!\n```\n\n## Why one more embedding tool?\n\nThere are almost as many static asset embedding tools for go as there are http routers. Why I decided to make one more was to have something extremely simple with no additional knobs and pulls. Just give the input, ouput and package name and don't care about anything else. I also didn't want force users to use any external 3rd party dependencies.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheppu%2Fembdr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheppu%2Fembdr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheppu%2Fembdr/lists"}