{"id":16344171,"url":"https://github.com/tyler-sommer/stick","last_synced_at":"2025-04-06T16:12:05.168Z","repository":{"id":20293354,"uuid":"23566903","full_name":"tyler-sommer/stick","owner":"tyler-sommer","description":"A golang port of the Twig templating engine","archived":false,"fork":false,"pushed_at":"2024-03-09T17:56:40.000Z","size":386,"stargazers_count":186,"open_issues_count":8,"forks_count":36,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-30T13:09:51.126Z","etag":null,"topics":["go","golang","stick","template-engine","twig"],"latest_commit_sha":null,"homepage":null,"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/tyler-sommer.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":"2014-09-02T05:58:06.000Z","updated_at":"2025-03-13T18:34:52.000Z","dependencies_parsed_at":"2024-06-18T15:22:16.850Z","dependency_job_id":"1fc63b63-6a86-4b48-b946-fc00b8eb25e0","html_url":"https://github.com/tyler-sommer/stick","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyler-sommer%2Fstick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyler-sommer%2Fstick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyler-sommer%2Fstick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyler-sommer%2Fstick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tyler-sommer","download_url":"https://codeload.github.com/tyler-sommer/stick/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509224,"owners_count":20950232,"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":["go","golang","stick","template-engine","twig"],"created_at":"2024-10-11T00:27:08.396Z","updated_at":"2025-04-06T16:12:05.140Z","avatar_url":"https://github.com/tyler-sommer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Stick\n=====\n\n[![CircleCI](https://circleci.com/gh/tyler-sommer/stick/tree/main.svg?style=shield)](https://circleci.com/gh/tyler-sommer/stick/tree/main)\n[![GoDoc](https://godoc.org/github.com/tyler-sommer/stick?status.svg)](https://godoc.org/github.com/tyler-sommer/stick)\n\nA Go language port of the [Twig](http://twig.sensiolabs.org/) templating engine. \n\n\nOverview\n--------\n\nThis project is split across two parts.\n\nPackage\n[`github.com/tyler-sommer/stick`](https://github.com/tyler-sommer/stick)\nis a Twig template parser and executor. It provides the core\nfunctionality and offers many of the same extension points as Twig like\nfunctions, filters, node visitors, etc.\n\nPackage\n[`github.com/tyler-sommer/stick/twig`](https://github.com/tyler-sommer/stick/tree/master/twig)\ncontains extensions to provide the most Twig-like experience for\ntemplate writers. It aims to feature the same functions, filters, etc.\nto be closely Twig-compatible.\n\n### Current status\n\n##### Stable, mostly feature complete\n\nStick itself is mostly feature-complete, with the exception of\nwhitespace control, and better error handling in places.\n\nStick is made up of three main parts: a lexer, a parser, and a template\nexecutor. Stick's lexer and parser are complete. Template execution is\nunder development, but essentially complete.\n\nSee the [to do list](#to-do) for additional information.\n\n### Alternatives\n\nThese alternatives are worth checking out if you're considering using Stick.\n\n- [`text/template`](https://pkg.go.dev/text/template) and [`html/template`](https://pkg.go.dev/html/template) from the Go standard library.\n- [`pongo2`](https://pkg.go.dev/github.com/flosch/pongo2/v5) is a full-featured Go language port of Django's templating language.\n\n\nInstallation\n------------\n\nStick is intended to be used as a library. The recommended way to install the library is using `go get`.\n\n```bash\ngo get -u github.com/tyler-sommer/stick\n```\n\n\nUsage\n-----\n\nExecute a simple Stick template.\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n    \n\t\"github.com/tyler-sommer/stick\"\n)\n\nfunc main() {\n\tenv := stick.New(nil)\n\tif err := env.Execute(\"Hello, {{ name }}!\", os.Stdout, map[string]stick.Value{\"name\": \"Tyler\"}); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\nSee [godoc for more information](https://pkg.go.dev/github.com/tyler-sommer/stick).\n\n\nTo do\n-----\n\n- [x] Autoescaping (see: [Twig compatibility](https://github.com/tyler-sommer/stick/blob/master/twig))\n- [ ] Whitespace control\n- [ ] Improve error reporting\n\n##### Further\n- [ ] Improve test coverage (especially error cases)\n- [ ] Custom operators and tags\n- [ ] Sandbox\n- [ ] Generate [native Go code from a given parser tree](https://github.com/tyler-sommer/go-stickgen)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyler-sommer%2Fstick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyler-sommer%2Fstick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyler-sommer%2Fstick/lists"}