Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liuwave/picgo-plugin-rename-file
A PicGo plugin for elegant file name prefix
https://github.com/liuwave/picgo-plugin-rename-file
Last synced: 2 months ago
JSON representation
A PicGo plugin for elegant file name prefix
- Host: GitHub
- URL: https://github.com/liuwave/picgo-plugin-rename-file
- Owner: liuwave
- License: mit
- Fork: true (gclove/picgo-plugin-super-prefix)
- Created: 2020-07-24T03:29:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-27T16:29:48.000Z (over 3 years ago)
- Last Synced: 2024-04-22T10:21:28.337Z (9 months ago)
- Language: TypeScript
- Size: 83 KB
- Stars: 83
- Watchers: 1
- Forks: 14
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: License
Awesome Lists containing this project
- Awesome-PicGo - picgo-plugin-rename-file
README
## picgo-plugin-rename-file
A PicGo plugin for customizing file name.
可以很自定义生成文件存储路径的插件,文件(包括路径)名称支持日期、随机字符串、文件MD5、原文件名、原文件目录结构等规则。
更多需求,欢迎PR或提ISSUE。
---
## 例如
`2020/07/24/674b96a992fac527a8332ac4adc89a14-filename-fa2c97-19-44-17.png`
---
## 修改配置参数后生效
![配置](https://raw.githubusercontent.com/liuwave/picgo-plugin-rename-file/master/images/config.png)
format,文件(路径)格式,默认为空,自定义文件路径及文件名,例如:
fix-dir/{localFolder:2}/{y}/{m}/{d}/{h}-{i}-{s}-{hash}-{origin}-{rand:6}
上传文件名为`/images/test/localImage.jpg`的文件时,会重命名为fix-dir/images/test/2020/07/24/21-40-31-36921a9c364ed4789d4bc684bcb81d62-localImage-fa2c97.jpg
命名规则:
- {y} 年,4位
- {m} 月,2位
- {d} 日期,2位
- {h} 小时,2位
- {i} 分钟,2位
- {s} 秒,2位
- {ms} 毫秒,3位(**v1.0.4**)
- {timestamp} 时间戳(秒),10位(**v1.0.4**)
- {hash},文件的md5值,32位
- {origin},文件原名(会去掉后缀)
- {rand:<count>}, 随机数,<count>表示个数,默认为6个,示例:{rand:32}、{rand}
- {localFolder:<count>}, <count>表示层级 ,默认为1,示例:{localFolder:6}、{localFolder}---
### 版权声明MIT
从 [gclove/picgo-plugin-super-prefix](https://github.com/gclove/picgo-plugin-super-prefix) fork而来,
做了些修改。