-
Notifications
You must be signed in to change notification settings - Fork 2
/
codetalk.code-workspace
53 lines (53 loc) · 1.72 KB
/
codetalk.code-workspace
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
"folders": [
{
"name": "drafts",
"path": "drafts"
},
{
"name": "posts",
"path": "posts"
},
{
"name": "images",
"path": "resources/images"
},
{
"name": "thumbnails",
"path": "resources/images/unoptimized"
},
{
"name": "project",
"path": "."
}
],
"settings": {
"editor.formatOnSave": true,
"[yaml]": {
"editor.formatOnSave": false
},
"[markdown]": {
"editor.formatOnSave": false
},
"workspaceKeybindings.codetalk.optimize-images.enabled": true
},
"tasks": {
"version": "2.0.0",
"tasks": [
{
"label": "Optimize Images",
"type": "shell",
// First install brew install rename. Then drop a file in resources/images/unoptimized and run this task.
// - Copy all PNG/JPG files to ./thumbnails
// - Move all PNG/JPG files to the images folder at ../
// - Rename all PNG/JPG files in ./thumbnails to have a .thumbnail.png/.thumbnail.jpg extension
// - Resize all PNG/JPG files in ./thumbnails to 70% of their original size
// - Move all PNG/JPG files in ./thumbnails to the images folder at ../../
"command": "(cp *.png ./thumbnails || true) && (cp *.jpg ./thumbnails || true) && (mv *.png ../ || true) && (mv *.jpg ../ || true) && cd ./thumbnails && ls && (rename 's/.png/.thumbnail.png/' *.png || true) && (rename 's/.jpg/.thumbnail.jpg/' *.jpg || true) && (mogrify -resize 70% *.thumbnail.png || true) && (mogrify -resize 70% *.thumbnail.jpg || true) && (mv *.png ../../ || true) && (mv *.jpg ../../ || true)",
"options": {
"cwd": "${workspaceFolder}/../resources/images/unoptimized"
}
}
]
}
}