File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed
Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @cesarlai/picgo-plugin-filename-format" ,
3- "version" : " 0.1.0 " ,
3+ "version" : " 0.1.1 " ,
44 "author" : " Cesar Lai" ,
55 "description" : " A picgo plugin to format filename by your setting." ,
66 "main" : " dist/index.js" ,
Original file line number Diff line number Diff line change 1+ import type { IPicGo } from 'picgo'
2+
3+ /**
4+ * afterUploadPlugins handle function
5+ */
6+ const handleAfterUploadPlugins = ( ctx : IPicGo ) => {
7+ ctx . output = ctx . output . map ( ( item ) => ( {
8+ ...item ,
9+ imgUrl : item . imgUrl ? decodeURIComponent ( item . imgUrl ) : item . imgUrl
10+ } ) )
11+
12+ return ctx
13+ }
14+
15+ export default handleAfterUploadPlugins
Original file line number Diff line number Diff line change 11import type { IPicGo } from 'picgo'
22import handleBeforeTransformPlugins from './beforeTransformPlugins'
33import handleBeforeUploadPlugins from './beforeUploadPlugins'
4+ import handleAfterUploadPlugins from './afterUploadPlugins'
45
56const PLUGIN_NAME : Readonly < string > = 'filename-format'
67
@@ -15,6 +16,9 @@ function pluginImageNameFormat(ctx: IPicGo) {
1516 ctx . helper . beforeUploadPlugins . register ( PLUGIN_NAME , {
1617 handle : handleBeforeUploadPlugins
1718 } )
19+ ctx . helper . afterUploadPlugins . register ( PLUGIN_NAME , {
20+ handle : handleAfterUploadPlugins
21+ } )
1822 }
1923
2024 return {
You can’t perform that action at this time.
0 commit comments