Skip to content

Commit b9eb744

Browse files
committed
Add workspace and tasks, update links to part 3
1 parent 7360add commit b9eb744

5 files changed

Lines changed: 1755 additions & 9 deletions

File tree

.vscode/settings.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
2-
"editor.formatOnSave": true,
3-
"[yaml]": {
4-
"editor.formatOnSave": false
5-
},
6-
"[markdown]": {
7-
"editor.formatOnSave": false
8-
}
9-
}
2+
"editor.formatOnSave": true,
3+
"[yaml]": {
4+
"editor.formatOnSave": false
5+
},
6+
"[markdown]": {
7+
"editor.formatOnSave": false
8+
},
9+
"workspaceKeybindings.codetalk.optimize-images.enabled": true
10+
}

codetalk.code-workspace

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"folders": [
3+
{
4+
"name": "posts",
5+
"path": "posts"
6+
},
7+
{
8+
"name": "drafts",
9+
"path": "posts-draft"
10+
},
11+
{
12+
"name": "images",
13+
"path": "resources/images"
14+
},
15+
{
16+
"name": "thumbnails",
17+
"path": "resources/images/unoptimized"
18+
},
19+
{
20+
"name": "project",
21+
"path": "."
22+
}
23+
],
24+
"settings": {
25+
"editor.formatOnSave": true,
26+
"[yaml]": {
27+
"editor.formatOnSave": false
28+
},
29+
"[markdown]": {
30+
"editor.formatOnSave": false
31+
},
32+
"workspaceKeybindings.codetalk.optimize-images.enabled": true
33+
},
34+
"tasks": {
35+
"version": "2.0.0",
36+
"tasks": [
37+
{
38+
"label": "Optimize Images",
39+
"type": "shell",
40+
// First install brew install rename. Then drop a file in resources/images/unoptimized and run this task.
41+
// - Copy all PNG/JPG files to ./thumbnails
42+
// - Move all PNG/JPG files to the images folder at ../
43+
// - Rename all PNG/JPG files in ./thumbnails to have a .thumbnail.png/.thumbnail.jpg extension
44+
// - Resize all PNG/JPG files in ./thumbnails to 70% of their original size
45+
// - Move all PNG/JPG files in ./thumbnails to the images folder at ../../
46+
"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)",
47+
"options": {
48+
"cwd": "${workspaceFolder}/../resources/images/unoptimized"
49+
}
50+
}
51+
]
52+
}
53+
}

0 commit comments

Comments
 (0)