{"id":23900836,"url":"https://github.com/aerogo/pixy","last_synced_at":"2026-03-11T21:36:47.784Z","repository":{"id":57480597,"uuid":"71847344","full_name":"aerogo/pixy","owner":"aerogo","description":":deciduous_tree: Template compiler similar to Jade/Pug.","archived":false,"fork":false,"pushed_at":"2019-09-04T02:27:27.000Z","size":110,"stargazers_count":22,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T21:05:51.729Z","etag":null,"topics":["go","template-engine","template-language"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aerogo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"akyoto","patreon":"eduardurbach"}},"created_at":"2016-10-25T01:26:57.000Z","updated_at":"2023-05-03T05:45:04.000Z","dependencies_parsed_at":"2022-09-26T16:31:05.619Z","dependency_job_id":null,"html_url":"https://github.com/aerogo/pixy","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerogo%2Fpixy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerogo%2Fpixy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerogo%2Fpixy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerogo%2Fpixy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aerogo","download_url":"https://codeload.github.com/aerogo/pixy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232518489,"owners_count":18535972,"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","template-engine","template-language"],"created_at":"2025-01-04T20:39:41.775Z","updated_at":"2026-03-11T21:36:47.755Z","avatar_url":"https://github.com/aerogo.png","language":"Go","funding_links":["https://github.com/sponsors/akyoto","https://patreon.com/eduardurbach"],"categories":[],"sub_categories":[],"readme":"# pixy\n\n[![Godoc][godoc-image]][godoc-url]\n[![Report][report-image]][report-url]\n[![Tests][tests-image]][tests-url]\n[![Coverage][coverage-image]][coverage-url]\n[![Sponsor][sponsor-image]][sponsor-url]\n\nPixy compiles `.pixy` templates to native Go code to profit from type system checks and high performance DOM rendering.\nThe generated code usually renders templates 300-400% faster than Jade/Pug due to byte buffer pooling and streaming.\n\n## CLI\n\nIf you're looking for the official compiler, please install [pack](https://github.com/aerogo/pack).\n\n## Syntax\n\nA pixy template is a collection of components.\n\n```jade\ncomponent Hello(person string)\n\th1= \"Hello \" + person\n```\n\nYou can define multiple components in a single file:\n\n```jade\ncomponent Hello\n\th1 Hello\n\ncomponent World\n\th1 World\n```\n\nAnd combine multiple components in one:\n\n```jade\ncomponent Layout\n\thtml\n\t\thead\n\t\t\tTitle(\"Website title.\")\n\t\tbody\n\t\t\tContent(\"This is the content.\")\n\t\t\tSidebar(\"This is the sidebar.\")\n\ncomponent Title(title string)\n\ttitle= title\n\ncomponent Content(text string)\n\tmain= text\n\ncomponent Sidebar(text string)\n\taside= text\n```\n\nAdd IDs with the suffix `#`:\n\n```jade\ncomponent Hello\n\th1#greeting Hello World\n```\n\nAdd classes with the suffix `.`:\n\n```jade\ncomponent Hello\n\th1.greeting Hello World\n```\n\nAssign element properties:\n\n```jade\ncomponent Hello\n\th1(title=\"Greeting\") Hello World\n```\n\nUse Go code for the text content:\n\n```jade\ncomponent Hello\n\th1= strconv.Itoa(123)\n```\n\nUse Go code in values:\n\n```jade\ncomponent Hello\n\th1(title=\"Greeting \" + strconv.Itoa(123)) Hello World\n```\n\nEmbed HTML with the suffix `!=`:\n\n```jade\ncomponent Hello\n\tdiv!= \"\u003ch1\u003eHello\u003c/h1\u003e\"\n```\n\nCall a parameter-less component:\n\n```jade\ncomponent HelloCopy\n\tHello\n\ncomponent Hello\n\th1 Hello\n```\n\nCall a component that requires parameters:\n\n```jade\ncomponent HelloWorld\n\tHello(\"World\", 42)\n\ncomponent Hello(person string, magicNumber int)\n\th1= \"Hello \" + person\n\tp= magicNumber\n```\n\nIterate over a slice:\n\n```jade\ncomponent ToDo(items []string)\n\tul\n\t\teach item in items\n\t\t\tli= item\n```\n\nIterate over a slice in reversed order:\n\n```jade\ncomponent ToDo(items []string)\n\tul\n\t\teach item in items reversed\n\t\t\tli= item\n```\n\nFor loops (`each` is just syntactical sugar):\n\n```jade\ncomponent ToDo(items []string)\n\tul\n\t\tfor _, item := range items\n\t\t\tli= item\n```\n\nIf conditions:\n\n```jade\ncomponent Condition(ok bool)\n\tif ok\n\t\th1 Yes!\n\telse\n\t\th1 No!\n```\n\n## API\n\n```go\ncomponents, err := pixy.Compile(src)\n```\n\n## Style\n\nPlease take a look at the [style guidelines](https://github.com/akyoto/quality/blob/master/STYLE.md) if you'd like to make a pull request.\n\n## Sponsors\n\n| [![Cedric Fung](https://avatars3.githubusercontent.com/u/2269238?s=70\u0026v=4)](https://github.com/cedricfung) | [![Scott Rayapoullé](https://avatars3.githubusercontent.com/u/11772084?s=70\u0026v=4)](https://github.com/soulcramer) | [![Eduard Urbach](https://avatars3.githubusercontent.com/u/438936?s=70\u0026v=4)](https://twitter.com/eduardurbach) |\n| --- | --- | --- |\n| [Cedric Fung](https://github.com/cedricfung) | [Scott Rayapoullé](https://github.com/soulcramer) | [Eduard Urbach](https://eduardurbach.com) |\n\nWant to see [your own name here?](https://github.com/users/akyoto/sponsorship)\n\n[godoc-image]: https://godoc.org/github.com/aerogo/pixy?status.svg\n[godoc-url]: https://godoc.org/github.com/aerogo/pixy\n[report-image]: https://goreportcard.com/badge/github.com/aerogo/pixy\n[report-url]: https://goreportcard.com/report/github.com/aerogo/pixy\n[tests-image]: https://cloud.drone.io/api/badges/aerogo/pixy/status.svg\n[tests-url]: https://cloud.drone.io/aerogo/pixy\n[coverage-image]: https://codecov.io/gh/aerogo/pixy/graph/badge.svg\n[coverage-url]: https://codecov.io/gh/aerogo/pixy\n[sponsor-image]: https://img.shields.io/badge/github-donate-green.svg\n[sponsor-url]: https://github.com/users/akyoto/sponsorship\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faerogo%2Fpixy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faerogo%2Fpixy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faerogo%2Fpixy/lists"}