npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hexo-console-rename

v3.0.0

Published

Hexo console plug-in to rename post file according to its title

Downloads

7

Readme

hexo-console-rename NPM version Dependency Status

Hexo console plug-in to rename post file according to its title, if asset folder is also renamed if exsits

Install

Install using npm.

For hexo 2.x

$ npm install hexo-console-rename@2 --save

For hexo 3.x

$ npm install hexo-console-rename@3 --save

Background

To know more about this plug-in, check out this post.

Usage

Rename specific file

  $ hexo rename source/_post/some_post_with_wrong_file_name.md

  [find] source/_post/some_post_with_wrong_file_name.md
  [rename] source/_post/some_post_with_wrong_file_name.md -> source/_post/new_file_name_from_title.md
  [rename] source/_post/some_post_with_wrong_file_name -> source/_post/new_file_name_from_title

Rename with glob

IMPORTANT TIP Commit all your files into git before excute this command

  $ hexo r source/**/*.md

  [find] source/_drafts/name.md
  [find] source/_posts/2014-08-18-name.md
  [find] source/_posts/codepen.md
  [find] source/_posts/image.md
  [find] source/_posts/cool_post.md
  [find] source/_posts/new_post.md
  [rename] source/_drafts/name.md -> source/_drafts/name-is-cool.md
  [rename] source/_posts/2014-08-18-name.md -> source/_posts/2014-08-18-name-is-something-really-cool.md
  [rename] source/_drafts/name -> source/_drafts/name-is-cool
  [rename] source/_posts/2014-08-18-name -> source/_posts/2014-08-18-name-is-something-really-cool

Update published posts

When no arg is passed, it is equals to hexo rename source/_posts/*.*

  $ hexo rename
  [find] source/_posts/2014-03-02-new_post.md
  [find] source/_posts/2014-08-18-name.md
  [rename] source/_posts/2014-08-18-name.md -> source/_posts/2014-08-18-name-is-something-really-cool.md
  [rename] source/_posts/2014-08-18-name -> source/_posts/2014-08-18-name-is-something-really-cool

Advanced Usage

hexo-console-rename can be used not only sync file name with title, it does more.

Synchronize TimeStamp in Filename

If 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.

hexo-console-rename can help you on this.

IMPORTANT TIP Commit all your files into git before excute this command

  $ hexo r source/**/*.md

  [find] source/_posts/2014-08-18-name.md
  [find] source/_posts/codepen.md
  [find] source/_posts/image.md
  [find] source/_posts/cool_post.md
  [find] source/_posts/new_post.md
  [rename] source/_posts/2014-08-18-name.md -> source/_posts/2014-08-19-name.md
  [rename] source/_posts/2014-08-18-name -> source/_posts/2014-08-19-name

Migrate Post File Name

Suppose 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.

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.

Suppose you changed new_post_name from :title.md to :year-:month-:day-:title.md.

IMPORTANT TIP Commit all your files into git before excute this command

  $ hexo r -p ':title.md' source/**/*.md

  [find] source/_posts/2014-08-17-codepen.md
  [find] source/_posts/2014-08-18-name-is-something-really-cool.md
  [find] source/_posts/2014-08-19-name-is-cool.md
  [find] source/_posts/image.md
  [find] source/_posts/post.md
  [find] source/_posts/cool-post.md
  [rename] source/_posts/image.md -> source/_posts/2014-08-15-image.md
  [rename] source/_posts/cool-post.md -> source/_posts/2014-08-15-post.md
  [rename] source/_posts/.md -> source/_posts/2014-08-15-cool-post.md
  [rename] source/_posts/image -> source/_posts/2014-08-15-image
  [rename] source/_posts/post -> source/_posts/2014-08-15-post
  [rename] source/_posts/cool-post -> source/_posts/2014-08-15-cool-post

License

MIT

NPM downloads