Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ coverImage: 'CKSource-logo-2.jpg'
If you are working in VS Code in the browser, you can drag-and-drop images from
your file explorer into the browser window.

**NOTE:** Images cannot be wider than 740px. If you want to resize all your
images to meet this requirement, run:

```
yarn resize-images
```

12. Image attribution.

- As much as possible, rely on graphics and illustrations you create and have
Expand Down
Binary file modified blog/cake-conf-2026-relacja/images/cakeconfcake.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/cake-conf-2026-relacja/images/stand.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/cake-conf-2026-relacja/images/wykladcake1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/cake-conf-2026-relacja/images/wykladcake2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/cake-conf-2026-relacja/images/wykladcake3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/jak-wybierac-narzedzia/images/biznes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/jak-wybierac-narzedzia/images/cel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/jak-wybierac-narzedzia/images/kompromis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/jak-wybierac-narzedzia/images/rzeczywistosc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/jak-wybierac-narzedzia/images/wymagania.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/komunikaty-o-sukcesie/images/Atlassian-example-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/komunikaty-o-sukcesie/images/Atlassian-example-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/komunikaty-o-sukcesie/images/Atlassian-icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/komunikaty-o-sukcesie/images/Moodle-example-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/komunikaty-o-sukcesie/images/Moodle-example-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/komunikaty-o-sukcesie/images/Moodle-example-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/komunikaty-o-sukcesie/images/Slack-example-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/komunikaty-o-sukcesie/images/Slack-example-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/notatki-graficzne/images/upload_0092.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/release-notes-co-dzis-serwuje-kuchnia/images/rn_adobe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/release-notes-co-dzis-serwuje-kuchnia/images/rn_figma.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/release-notes-co-dzis-serwuje-kuchnia/images/rn_openAI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blog/release-notes-co-dzis-serwuje-kuchnia/images/rn_vscode.png
Binary file modified blog/soap-rocznica/images/2014_aula.jpg
Binary file modified blog/soap-rocznica/images/2015_Jadzka_Rysuje.jpg
Binary file modified blog/soap-rocznica/images/2017_garden.jpg
Binary file modified blog/soap-rocznica/images/2018_garden.jpg
Binary file modified blog/soap-rocznica/images/2019_michal_pawel.jpg
Binary file modified blog/soap-rocznica/images/2022_piter.jpg
Binary file modified blog/soap-rocznica/images/2022_wyklad.jpg
Binary file modified blog/soap-rocznica/images/2023_publika.jpg
Binary file modified blog/soap-rocznica/images/2023_soapy_crew.jpg
Binary file modified blog/soap-rocznica/images/3D.jpg
Binary file modified blog/soap-rocznica/images/Manggha_Museum.jpg
Binary file modified blog/soap-rocznica/images/converstations.jpg
Binary file modified blog/soap-rocznica/images/edu_summit.jpg
Binary file modified blog/soap-rocznica/images/laptopy.jpg
Binary file modified blog/soap-rocznica/images/load2.png
Binary file modified blog/soap-rocznica/images/mydlo.jpg
Binary file modified blog/soap-rocznica/images/naglowek-conference-szary.png
Binary file modified blog/soap-rocznica/images/noz.jpg
Binary file modified blog/soap-rocznica/images/pawel.png
Binary file modified blog/soap-rocznica/images/super.jpg
Binary file modified blog/techwriter-rocznica/images/raport.png
Binary file modified blog/techwriter-rocznica/images/redakcja.jpg
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"build": "yarn test-image-size && docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
Expand All @@ -15,6 +15,8 @@
"typecheck": "tsc",
"prettier": "prettier . --write",
"remove-unused-cover-images": "node src/scripts/remove-unused-cover-images.mjs",
"resize-images": "node src/scripts/resize-images.mjs",
"test-image-size": "RESIZE_IMAGES_DRY_RUN=true yarn resize-images",
"delete-old-events": "node src/scripts/delete-old-events.mjs && yarn remove-unused-cover-images"
},
"dependencies": {
Expand Down Expand Up @@ -45,6 +47,7 @@
"fast-xml-parser": "^5.0.9",
"gm": "^1.25.0",
"prettier": "3.0.2",
"sharp": "^0.35.5",
"typescript": "6",
"yaml-loader": "^0.8.0"
},
Expand All @@ -64,4 +67,4 @@
"node": ">=16.14"
},
"packageManager": "yarn@4.18.0"
}
}
67 changes: 34 additions & 33 deletions src/scripts/resize-images.mjs
Original file line number Diff line number Diff line change
@@ -1,48 +1,49 @@
import { __dirname, blogPath, getAllFilesRecursively } from './helpers.mjs';
import gm from 'gm';
import { readFile, writeFile } from 'fs/promises';
import { resolve } from 'path';
import sharp from 'sharp';
import { __dirname, blogPath, getAllFilesRecursively } from './helpers.mjs';

const isDryRun = process.env.RESIZE_IMAGES_DRY_RUN === 'true';
const targetWidth = 740;
const im = gm.subClass({ imageMagick: '7+' });
const coverPath = resolve(__dirname, '../../static/img/cover');

const allImagesInBlog = [];
for (const dir of [blogPath, coverPath]) {
getAllFilesRecursively(dir, allImagesInBlog, '.png');
getAllFilesRecursively(dir, allImagesInBlog, '.jpg');
}

getAllFilesRecursively(blogPath, allImagesInBlog, '.png');
getAllFilesRecursively(blogPath, allImagesInBlog, '.jpg');
getAllFilesRecursively(
resolve(__dirname, '../../static/img/cover'),
allImagesInBlog,
'.png'
);
getAllFilesRecursively(
resolve(__dirname, '../../static/img/cover'),
allImagesInBlog,
'.jpg'
console.log(
`Found ${allImagesInBlog.length} images in blog, checking their size...`
);

console.log({ allImagesInBlog }, `Found ${allImagesInBlog.length}`);

let count = 0;
for (const imagePath of allImagesInBlog) {
im(imagePath).size(function (err, size) {
if (err) {
throw err;
}
const width = size.width;
console.log(width, imagePath);
try {
// Read into a buffer so we can safely overwrite the same file
const input = await readFile(imagePath);
const { width } = await sharp(input, { failOn: 'none' }).metadata();

if (width > targetWidth) {
im(imagePath)
.resize(targetWidth)
.write(imagePath, function (err) {
if (!err) {
count++;
console.log(
`Resized ${imagePath} from ${width}px to ${targetWidth}px`
);
}
});
if (isDryRun) {
console.error(
`At least one image is larger than ${targetWidth}.
${imagePath} is ${width}px wide.
Please run "yarn resize-images" to resize them before building."`
);
process.exit(1);
}

const output = await sharp(input, { failOn: 'none' })
.resize({ width: targetWidth })
.toBuffer();
await writeFile(imagePath, output);
count++;
console.log(`Resized ${imagePath} from ${width}px to ${targetWidth}px`);
}
});
} catch (err) {
console.error(`Failed on ${imagePath}:`, err.message);
}
}

console.log(`Resized ${count} images`);
Binary file modified static/img/cover/A clean and modern b.png
Binary file modified static/img/cover/ankieta_plac.png
Binary file modified static/img/cover/cakeconf26.jpg
Binary file modified static/img/cover/jak-wybierac.png
Binary file modified static/img/cover/komunikaty-o-sukcesie.png
Binary file modified static/img/cover/linia-komend.png
Binary file modified static/img/cover/release-notes-to-nie-changelog.png.png
Binary file modified static/img/cover/rn_canva.png
Binary file modified static/img/cover/rocznica_logo.png
Binary file modified static/img/cover/soap_title.jpg
Binary file modified static/img/cover/zanim-dodasz-wideo-cover.png
Loading
Loading