{"id":33014543,"url":"https://github.com/lashoun/slugify","last_synced_at":"2025-11-19T09:01:27.713Z","repository":{"id":188921125,"uuid":"180143686","full_name":"lashoun/slugify","owner":"lashoun","description":"ZSH plugin that converts filenames and directories to a web friendly format.","archived":false,"fork":true,"pushed_at":"2021-03-30T12:19:39.000Z","size":44,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-19T03:06:42.713Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"benlinton/slugify","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lashoun.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}},"created_at":"2019-04-08T12:24:47.000Z","updated_at":"2024-01-27T06:19:46.000Z","dependencies_parsed_at":"2023-08-17T13:58:12.995Z","dependency_job_id":null,"html_url":"https://github.com/lashoun/slugify","commit_stats":null,"previous_names":["lashoun/slugify"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lashoun/slugify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lashoun%2Fslugify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lashoun%2Fslugify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lashoun%2Fslugify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lashoun%2Fslugify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lashoun","download_url":"https://codeload.github.com/lashoun/slugify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lashoun%2Fslugify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285215532,"owners_count":27133906,"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","status":"online","status_checked_at":"2025-11-19T02:00:05.673Z","response_time":65,"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":[],"created_at":"2025-11-13T18:00:20.531Z","updated_at":"2025-11-19T09:01:27.708Z","avatar_url":"https://github.com/lashoun.png","language":"Shell","readme":"# Slugify\n\nSlugify is a ZSH plugin that converts filenames and directories to a web friendly format. Converted from the bash command [slugify](https://github.com/benlinton/slugify).\n\n## Installation\n\nI recommend [zplug](https://github.com/zplug/zplug). Add the following line in your `.zshrc`.\n```zsh\nzplug \"lashoun/slugify\"\n```\n\n## Usage Help\n\nSimply enter the slugify command without any arguments or with the -h option to view the usage help.\n\n```\n$ slugify -h\nusage: slugify [-abcdefhinptuv] source_file ...\n   -a: remove spaces immediately adjacent to dashes\n   -b: remove spaces immediately adjacent to dots\n   -c: consolidate consecutive spaces into single space\n   -d: replace spaces with dashes (instead of default underscores)\n   -e: do not replace special characters with regular characters\n   -f: treat existing non alpha-numeric characters (except dashes) as spaces\n   -h: help\n   -i: ignore case\n   -n: dry run\n   -p: treat existing non alpha-numeric characters as spaces\n   -t: treat existing dashes as spaces\n   -u: treat existing underscores as spaces (useful with -a, -c, or -d)\n   -v: verbose\n```\n\n## Usage Examples\n\nNote, most examples below are run in verbose mode (-v) to help illustrate the results.\n\nVerbose mode is unnecessary in real world scenarios.\n\n#### Provide escaped filenames:\n\n    $ slugify -v My\\ \\ file.txt\n    rename: My  file.txt -\u003e my__file.txt\n\n#### Alternatively provide unescaped filenames inside quotes:\n\n    $ slugify -v \"My  file.txt\"\n    rename: My  file.txt -\u003e my__file.txt\n\n#### Globs (like * and ?) work as well:\n\n    $ slugify -v *.txt\n    rename: My file.txt -\u003e my_file.txt\n    ignore: my_web_friendly_filename.txt\n\n#### Provide an unlimited number of arguments:\n\n    $ slugify -v \"My first file.txt\" \"My second file.txt\"\n    rename: My first file.txt -\u003e my_first_file.txt\n    rename: My second file.txt -\u003e my_second_file.txt\n\n#### Directories are also supported:\n\n    $ slugify -v \"My Directory\"\n    rename: My Directory -\u003e my_directory\n\n#### Consolidate consecutive spaces into single spaces:\n\n    $ slugify -vc \"My    consolidated    file.txt\"\n    rename: My    consolidated    file.txt -\u003e my_consolidated_file.txt\n\n#### Replace spaces with dashes:\n\n    $ slugify -vd \"My dashed file.txt\"\n    rename: My dashed file.txt -\u003e my-dashed-file.txt\n\nThe -d option replaces each space with a dash.\n\n    $ slugify -vd \"My  dashed  file.txt\"\n    rename: My  dashed  file.txt -\u003e my--dashed--file.txt\n\nCombine -d with -c (consolidate spaces) for a single dash between each word.\n\n    $ slugify -vdc \"My  dashed  file.txt\"\n    rename: My  dashed  file.txt -\u003e my-dashed-file.txt\n\n#### Ignore case:\n\n    $ slugify -vi \"UPPER CASE FILE.txt\"\n    rename: UPPER CASE FILE.txt -\u003e UPPER_CASE_FILE.txt\n\n#### Play it safe with a dry run:\n\nDry run mode does not alter the filesystem in any way.\n\n    $ slugify -n *\n    --- Begin dry run mode.\n    rename: My file.txt -\u003e my_file.txt\n    ignore: web_friendly_filename.txt\n    --- End dry run mode.\n\nDry run mode also allows you to test filenames that don't exist. Great for testing!\n\n    $ slugify -n \"Ghost File.txt\"\n    --- Begin dry run mode.\n    not found: Ghost File.txt\n    rename: Ghost File.txt -\u003e ghost_file.txt\n    --- End dry run mode.\n\nDry run mode automatically enables verbose mode so there is no need to include the -v option with -n.\n\n#### Handle spaces adjacent to dashes:\n\nIn this example, without -a the dashes end up surrounded by underscores.\n\n    $ slugify -v \"The Beatles - Yellow Submarine.mp3\"\n    rename: The Beatles - Yellow Submarine.mp3 -\u003e the_beatles_-_yellow_submarine.mp3\n\nBut with -a the adjacent spaces are removed.\n\n    $ slugify -va \"The Beatles - Yellow Submarine.mp3\"\n    rename: The Beatles - Yellow Submarine.mp3 -\u003e the_beatles-yellow_submarine.mp3\n\nThe -a only removes spaces immediately adjacent to a dash, which may not be the desired effect (below three spaces on either side of the dash get converted into two underscores because of -a).\n\n    $ slugify -va \"The Beatles   -   Yellow Submarine.mp3\"\n    rename: The Beatles   -   Yellow Submarine.mp3 -\u003e the_beatles__-__yellow_submarine.mp3\n\nBut -c consolidates spaces into a single space and then -a will remove the left over adjacent single spaces.\n\n    $ slugify -vac \"The Beatles   -   Yellow Submarine.mp3\"\n    rename: The Beatles - Yellow Submarine.mp3 -\u003e the_beatles-yellow_submarine.mp3\n\n#### Convert existing underscores into dashes\n\nThe -u treats underscores as spaces and -d converts spaces into dashes.\n\n    $ slugify -vud \"Spaces Dashes-And_Underscores.txt\"\n    rename: Spaces Dashes-And_Underscores.txt -\u003e spaces-dashes-and-underscores.txt\n\n#### Convert existing dashes into underscores\n\n    $ slugify -vt \"Spaces Dashes-And_Underscores.txt\"\n    rename: Spaces Dashes-And_Underscores.txt -\u003e spaces_dashes_and_underscores.txt\n\n","funding_links":[],"categories":["Plugins"],"sub_categories":["ZSH on Windows","Zinit (née zplugin)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flashoun%2Fslugify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flashoun%2Fslugify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flashoun%2Fslugify/lists"}