{"id":42267882,"url":"https://github.com/cvent/hogan","last_synced_at":"2026-01-27T06:51:38.592Z","repository":{"id":32004342,"uuid":"130282996","full_name":"cvent/hogan","owner":"cvent","description":"Customized handlebars wrapper, with config inheritance","archived":false,"fork":false,"pushed_at":"2026-01-10T01:07:37.000Z","size":520,"stargazers_count":15,"open_issues_count":16,"forks_count":10,"subscribers_count":9,"default_branch":"master","last_synced_at":"2026-01-10T23:14:00.231Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cvent.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-04-19T23:26:55.000Z","updated_at":"2025-11-05T08:59:11.000Z","dependencies_parsed_at":"2023-02-14T07:50:26.998Z","dependency_job_id":"cc8d7d55-1a43-4642-abd0-0843dd968833","html_url":"https://github.com/cvent/hogan","commit_stats":null,"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"purl":"pkg:github/cvent/hogan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvent%2Fhogan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvent%2Fhogan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvent%2Fhogan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvent%2Fhogan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cvent","download_url":"https://codeload.github.com/cvent/hogan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvent%2Fhogan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28806722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T06:25:51.065Z","status":"ssl_error","status_checked_at":"2026-01-27T06:25:50.640Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-27T06:51:36.234Z","updated_at":"2026-01-27T06:51:38.582Z","avatar_url":"https://github.com/cvent.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/cvent/hogan.svg?branch=master)](https://travis-ci.org/cvent/hogan)\n[![Build status](https://ci.appveyor.com/api/projects/status/xtdavsrk8fs27uox/branch/master?svg=true)](https://ci.appveyor.com/project/jonathanmorley/hogan/branch/master)\n\n# hogan\n\n## Purpose\n\nThe purpose of this project is to generate config overrides so that we can keep a template up to date, and populate values on the fly with ease at build time.\n\n## Installation\n\nGrab a binary for your OS from the [latest release](https://github.com/cvent/hogan/releases/latest), and put it somewhere in your PATH.\n\n### MacOS\n\n```sh\nbrew tap cvent/tap\nbrew install hogan\n```\n\n### Linux\n\n```sh\ncurl -LSfs https://japaric.github.io/trust/install.sh | sh -s -- --git cvent/hogan --target x86_64-unknown-linux-gnu --to /usr/local/bin\n```\n\n## Tests\n\nYou can run the tests via `cargo test`. The tests should always pass and all new behavior should be tested.\n\n## Usage\n\nOnce you have installed hogan, you can execute it as `hogan`.\nSome of the arguments are described below:\n\n * `environments-filter`: Regex specifying which environment(s) to update.\n * `templates`: The directory to use for searching for template files (recursively).\n * `configs`: The directory where hogan-formatted config files can be found (These are config.ENVIRONMENT.json files)\n\n## Example\n\n```\n    hogan transform --environments-filter ENVIRONMENT --templates . --configs ./Configs\n```\n\nYou can also create an alias of the above command and add to bash_profile\n```\n    hg() { hogan transform --configs ~/cventcode/hogan-configs/configs/ --templates . --templates-filter \"$1\" --environments-filter \"$2\"; }\n```\nand then use the alisa to generate config like\n```\n    hg tempate.yaml prod\n```\nthis will generate the config for prod environment using template.yaml as template file.\n\n## Custom handlers in config files\n\nThe following custom handlers exist\n\n### `comma-list`\nAllows an array of objects to be turned into a comma separated list by passing in an array:\n\n```rust,skt-helpers\n// Given a config of:\nlet config = json!({\n  \"Memcache\": {\n    \"Servers\": [\n      {\n        \"Endpoint\": \"192.168.1.100\",\n        \"Port\": \"1122\"\n      },\n      {\n        \"Endpoint\": \"192.168.1.101\",\n        \"Port\": \"1122\"\n      },\n      {\n        \"Endpoint\": \"192.168.1.102\",\n        \"Port\": \"1122\"\n      }\n    ]\n  }\n});\n\n// and a template of:\nlet template = \"{{#comma-list Memcache.Servers}}{{Endpoint}}:{{Port}}{{/comma-list}}\";\n\n// The helper will transform it into:\nlet transformed = \"192.168.1.100:1122,192.168.1.101:1122,192.168.1.102:1122\";\n```\n\n### `equal`, `eq`\nLike `if`, but compares the two arguments provided for equality:\n\n```rust,skt-helpers\n// Given a config of:\nlet config = json!({\n  \"Region\": {\n    \"Key\": \"TEST\"\n  }\n});\n\n// and a template of:\nlet template = r#\"{{#equal Region.Key \"TEST\"}}True{{else}}False{{/equal}}\"#;\n\n// The helper will transform it into:\nlet transformed = \"True\";\n```\n\n### `or`\nLogical OR two parameters:\n\n```rust,skt-helpers\n// Given a config of:\nlet config = json!({\n  \"Region\": {\n    \"Key\": \"TEST\"\n  }\n});\n\n// and a template of:\nlet template = r#\"{{#or (eq Region.Key \"TEST\") (eq Region.Key \"TEST2\")}}True{{else}}False{{/or}}\"#;\n\n// The helper will transform it into:\nlet transformed = \"True\";\n```\n\n### `yaml-string`\nEscapes a string for valid injection into a Yaml file:\n\n```rust,skt-helpers\n// Given a config of:\nlet config = json!({\n  \"app\": {\n    \"path\": \"C:\\\\Program Files\\\\My App\"\n  }\n});\n\n// and a template of:\nlet template = r#\"windows:\n  path: \"{{yaml-string app.path}}\"\"#;\n\n// The helper will transform it into:\nlet transformed = r#\"windows:\n  path: \"C:\\\\Program Files\\\\My App\"\"#;\n```\n\n### `url-rm-slash`\nRemoves the trailing slash on an endpoint:\n\n```rust,skt-helpers\n// Given a config of:\nlet config = json!({\n  \"SlashService\": {\n    \"endpoint\": \"https://slash.com/\"\n  }\n});\n\n// and a template of:\nlet template = \"{{url-rm-slash SlashService.endpoint}}\";\n\n// The helper will transform it into:\nlet transformed = \"https://slash.com\";\n```\n\n### `url-add-slash`\nAdds the trailing slashes on an endpoint:\n\n```rust,skt-helpers\n// Given a config of:\nlet config = json!({\n  \"NonSlashService\": {\n    \"endpoint\": \"https://nonslash.com\"\n  }\n});\n\n// and a template of:\nlet template = \"{{url-add-slash NonSlashService.endpoint}}\";\n\n// The helper will transform it into:\nlet transformed = \"https://nonslash.com/\";\n```\n\n### `url-rm-path`\nRemoves the last slash plus content to the end of the string:\n\n```rust,skt-helpers\n// Given a config of:\nlet config = json!({\n  \"PathService\": {\n    \"endpoint\": \"https://path.com/path/remove-this\"\n  }\n});\n\n// and a template of:\nlet template = \"{{url-rm-path PathService.endpoint}}\";\n\n// The helper will transform it into:\nlet transformed = \"https://path.com/path\";\n```\n\n## Helpful Information\n\n - [Handlebars](http://handlebarsjs.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvent%2Fhogan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcvent%2Fhogan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvent%2Fhogan/lists"}