{"id":24086717,"url":"https://github.com/zigzedd/zlugify","last_synced_at":"2026-02-22T03:03:20.575Z","repository":{"id":271629809,"uuid":"914069583","full_name":"zigzedd/zlugify","owner":"zigzedd","description":"[MIRROR] Generate ASCII slugs from unicode strings.","archived":false,"fork":false,"pushed_at":"2025-04-12T10:39:58.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T08:57:34.414Z","etag":null,"topics":["ascii","emoji","normalization","slug","slugify","transliteration","unicode","unidecode","utf8","zig","zig-library","zig-package"],"latest_commit_sha":null,"homepage":"https://code.zeptotech.net/zedd/zlugify","language":"Zig","has_issues":false,"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/zigzedd.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,"zenodo":null}},"created_at":"2025-01-08T22:19:41.000Z","updated_at":"2025-05-29T08:37:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"872e054e-8948-44ae-9f6e-8d060ec0f98c","html_url":"https://github.com/zigzedd/zlugify","commit_stats":null,"previous_names":["zigzedd/zlugify"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/zigzedd/zlugify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigzedd%2Fzlugify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigzedd%2Fzlugify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigzedd%2Fzlugify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigzedd%2Fzlugify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zigzedd","download_url":"https://codeload.github.com/zigzedd/zlugify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigzedd%2Fzlugify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29704401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T23:35:04.139Z","status":"online","status_checked_at":"2026-02-22T02:00:08.193Z","response_time":110,"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":["ascii","emoji","normalization","slug","slugify","transliteration","unicode","unidecode","utf8","zig","zig-library","zig-package"],"created_at":"2025-01-10T02:25:58.856Z","updated_at":"2026-02-22T03:03:20.570Z","avatar_url":"https://github.com/zigzedd.png","language":"Zig","readme":"\u003ch1 align=\"center\"\u003e\n\tzlugify\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\tGenerate ASCII slugs from unicode strings\n\u003c/p\u003e\n\nzlugify is part of [_zedd_](https://code.zeptotech.net/zedd), a collection of useful libraries for zig.\n\n## zlugify\n\n_zlugify_ is a library to generate slugs from all types of UTF-8 encoded strings. It uses [anyascii.zig](https://code.zeptotech.net/zedd/anyascii.zig) to convert UTF-8 encoded strings into ASCII-only strings.\n\n## Versions\n\nzlugify 1.1.0 is made and tested with zig 0.14.0.\n\n## How to use\n\n### Install\n\nIn your project directory:\n\n```shell\n$ zig fetch --save https://code.zeptotech.net/zedd/zlugify/archive/v1.1.0.tar.gz\n```\n\nIn `build.zig`:\n\n```zig\n// Add zlugify dependency.\nconst zlugify = b.dependency(\"zlugify\", .{\n\t.target = target,\n\t.optimize = optimize,\n});\nexe.root_module.addImport(\"zlugify\", zlugify.module(\"zlugify\"));\n```\n\n### Examples\n\nThese examples are highly inspired from the test cases that you can find at the end of [`lib.zig`](https://code.zeptotech.net/zedd/zlugify/src/branch/main/src/lib.zig).\n\n#### trim and normalize\n\n```zig\nconst slugify = @import(\"zlugify\").slugify;\n\nconst slug = try slugify(allocator, \"   This is a test.\\t\\n\");\ndefer allocator.free(slug);\ntry std.testing.expectEqualStrings(\"this-is-a-test\", slug);\n```\n\n#### remove diacritics and unnecessary spaces\n\n```zig\nconst slugify = @import(\"zlugify\").slugify;\n\nconst slug = try slugify(allocator, \"SôMÈThing   \\t    ÉLSÈ\");\ndefer allocator.free(slug);\ntry std.testing.expectEqualStrings(\"something-else\", slug);\n```\n\n#### convert non-latin characters\n\n```zig\nconst slugify = @import(\"zlugify\").slugify;\n\nconst slug = try slugify(allocator, \"埼玉 県\");\ndefer allocator.free(slug);\ntry std.testing.expectEqualStrings(\"qiyu-xian\", slug);\n```\n\n#### convert ascii-like characters\n\n```zig\nconst slugify = @import(\"zlugify\").slugify;\n\nconst slug = try slugify(allocator, \"𝒔𝒍𝒖𝒈𝒊𝒇𝒚 𝒂 𝒔𝒕𝒓𝒊𝒏𝒈\");\ndefer allocator.free(slug);\ntry std.testing.expectEqualStrings(\"slugify-a-string\", slug);\n```\n\n#### convert emojis\n\n```zig\nconst slugify = @import(\"zlugify\").slugify;\n\nconst slug = try slugify(allocator, \"hello 🦊\");\ndefer allocator.free(slug);\ntry std.testing.expectEqualStrings(\"hello-fox\", slug);\n```\n\n#### customized separator\n\n```zig\nconst slugifySeparator = @import(\"zlugify\").slugify;\n\nconst slug = try slugifySeparator(allocator, \"tôi yêu những chú kỳ lân\", '_');\ndefer allocator.free(slug);\ntry std.testing.expectEqualStrings(\"toi_yeu_nhung_chu_ky_lan\", slug);\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzigzedd%2Fzlugify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzigzedd%2Fzlugify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzigzedd%2Fzlugify/lists"}