{"id":19806641,"url":"https://github.com/timnew/hexo-console-rename","last_synced_at":"2025-05-01T07:31:03.446Z","repository":{"id":19814267,"uuid":"23074775","full_name":"timnew/hexo-console-rename","owner":"timnew","description":"Hexo console plug-in to rename post file according to its title","archived":false,"fork":false,"pushed_at":"2015-03-21T15:11:10.000Z","size":191,"stargazers_count":7,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T10:52:11.424Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/timnew/hexo-console-rename","language":"JavaScript","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/timnew.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}},"created_at":"2014-08-18T14:42:51.000Z","updated_at":"2023-11-04T14:44:49.000Z","dependencies_parsed_at":"2022-08-25T18:52:47.358Z","dependency_job_id":null,"html_url":"https://github.com/timnew/hexo-console-rename","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timnew%2Fhexo-console-rename","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timnew%2Fhexo-console-rename/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timnew%2Fhexo-console-rename/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timnew%2Fhexo-console-rename/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timnew","download_url":"https://codeload.github.com/timnew/hexo-console-rename/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251840164,"owners_count":21652292,"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":[],"created_at":"2024-11-12T09:08:04.673Z","updated_at":"2025-05-01T07:31:03.108Z","avatar_url":"https://github.com/timnew.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"hexo-console-rename [![NPM version][npm-image]][npm-url] [![Dependency Status][depstat-image]][depstat-url]\n===================\n\n\u003e [Hexo] console plug-in to rename post file according to its title, if asset folder is also renamed if exsits\n\n## Install\n\nInstall using [npm][npm-url].\n\nFor hexo 2.x\n\n    $ npm install hexo-console-rename@2 --save\n\nFor hexo 3.x\n\n    $ npm install hexo-console-rename@3 --save\n\n## Background\n\nTo know more about this plug-in, check out this [post].\n\n## Usage\n\n### Rename specific file\n\n```\n  $ hexo rename source/_post/some_post_with_wrong_file_name.md\n\n  [find] source/_post/some_post_with_wrong_file_name.md\n  [rename] source/_post/some_post_with_wrong_file_name.md -\u003e source/_post/new_file_name_from_title.md\n  [rename] source/_post/some_post_with_wrong_file_name -\u003e source/_post/new_file_name_from_title\n```\n### Rename with glob\n\n**IMPORTANT TIP** Commit all your files into git before excute this command\n```\n  $ hexo r source/**/*.md\n\n  [find] source/_drafts/name.md\n  [find] source/_posts/2014-08-18-name.md\n  [find] source/_posts/codepen.md\n  [find] source/_posts/image.md\n  [find] source/_posts/cool_post.md\n  [find] source/_posts/new_post.md\n  [rename] source/_drafts/name.md -\u003e source/_drafts/name-is-cool.md\n  [rename] source/_posts/2014-08-18-name.md -\u003e source/_posts/2014-08-18-name-is-something-really-cool.md\n  [rename] source/_drafts/name -\u003e source/_drafts/name-is-cool\n  [rename] source/_posts/2014-08-18-name -\u003e source/_posts/2014-08-18-name-is-something-really-cool\n```\n\n### Update published posts\n\nWhen no arg is passed, it is equals to `hexo rename source/_posts/*.*`\n\n```\n  $ hexo rename\n  [find] source/_posts/2014-03-02-new_post.md\n  [find] source/_posts/2014-08-18-name.md\n  [rename] source/_posts/2014-08-18-name.md -\u003e source/_posts/2014-08-18-name-is-something-really-cool.md\n  [rename] source/_posts/2014-08-18-name -\u003e source/_posts/2014-08-18-name-is-something-really-cool\n```\n\n## Advanced Usage\n\n`hexo-console-rename` can be used not only sync file name with `title`, it does more.\n\n### Synchronize TimeStamp in Filename\n\nIf you have `timestamp` in your file name, then if you updated the `date` field in your front-matter. You'll probably wish to update the file name also.\n\n`hexo-console-rename` can help you on this.\n\n**IMPORTANT TIP** Commit all your files into git before excute this command\n```\n  $ hexo r source/**/*.md\n\n  [find] source/_posts/2014-08-18-name.md\n  [find] source/_posts/codepen.md\n  [find] source/_posts/image.md\n  [find] source/_posts/cool_post.md\n  [find] source/_posts/new_post.md\n  [rename] source/_posts/2014-08-18-name.md -\u003e source/_posts/2014-08-19-name.md\n  [rename] source/_posts/2014-08-18-name -\u003e source/_posts/2014-08-19-name\n```\n\n### Migrate Post File Name\n\nSuppose you update the `new_post_name` field in your `_config.yml`, then you might wish to migrate all post to fit the new name pattern.\n\n`hexo-console-rename` can help you on this. You need to specify the old pattern with `--old-permalink` (`-p` for short), then all post will be migrated automatically.\n\nSuppose you changed `new_post_name` from `:title.md` to `:year-:month-:day-:title.md`.\n\n**IMPORTANT TIP** Commit all your files into git before excute this command\n```\n  $ hexo r -p ':title.md' source/**/*.md\n\n  [find] source/_posts/2014-08-17-codepen.md\n  [find] source/_posts/2014-08-18-name-is-something-really-cool.md\n  [find] source/_posts/2014-08-19-name-is-cool.md\n  [find] source/_posts/image.md\n  [find] source/_posts/post.md\n  [find] source/_posts/cool-post.md\n  [rename] source/_posts/image.md -\u003e source/_posts/2014-08-15-image.md\n  [rename] source/_posts/cool-post.md -\u003e source/_posts/2014-08-15-post.md\n  [rename] source/_posts/.md -\u003e source/_posts/2014-08-15-cool-post.md\n  [rename] source/_posts/image -\u003e source/_posts/2014-08-15-image\n  [rename] source/_posts/post -\u003e source/_posts/2014-08-15-post\n  [rename] source/_posts/cool-post -\u003e source/_posts/2014-08-15-cool-post\n```\n\n## License\nMIT\n\n[![NPM downloads][npm-downloads]][npm-url]\n\n[homepage]: https://github.com/timnew/hexo-console-rename\n\n[npm-url]: https://npmjs.org/package/hexo-console-rename\n[npm-image]: http://img.shields.io/npm/v/hexo-console-rename.svg?style=flat\n[npm-downloads]: http://img.shields.io/npm/dm/hexo-console-rename.svg?style=flat\n\n[depstat-url]: https://gemnasium.com/timnew/hexo-console-rename\n[depstat-image]: http://img.shields.io/gemnasium/timnew/hexo-console-rename.svg?style=flat\n\n[Hexo]: http://hexo.io/\n[post]: http://timnew.dev/blog/2014/08/19/Hexo-plug-in-to-rename-the-post-according-to-title-automatically/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimnew%2Fhexo-console-rename","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimnew%2Fhexo-console-rename","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimnew%2Fhexo-console-rename/lists"}