mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 00:27:21 +02:00
docs: update showcase images; remove GraphQL Code Generator site (#6231)
* Showcase: Update images
* Showcase: Remove sites that are not working, and have not been working since yesterday.
* Suspected no longer using docusaurus (please confirm)
* Revert "Showcase: Remove sites that are not working, and have not been working since yesterday."
This reverts commit c963f120e9
.
* add notices
* test screen resolution
* all of them
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
parent
e4eaac07f2
commit
1c7b0d1353
28 changed files with 14 additions and 11 deletions
|
@ -9,6 +9,8 @@
|
|||
import sharp from 'sharp';
|
||||
import fs from 'fs/promises';
|
||||
import path from 'path';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import imageSize from 'image-size';
|
||||
|
||||
const allImages = (
|
||||
await fs.readdir(new URL('../../website/src/data/showcase', import.meta.url))
|
||||
|
@ -23,6 +25,12 @@ await Promise.all(
|
|||
`../../website/src/data/showcase/${img}`,
|
||||
import.meta.url,
|
||||
).pathname;
|
||||
const {width, height} = imageSize(imgPath);
|
||||
if (width === 640 && height === 320) {
|
||||
// Do not emit if no resized. Important because we
|
||||
// can't guarantee idempotency during resize -> optimization
|
||||
return;
|
||||
}
|
||||
const data = await sharp(imgPath)
|
||||
.resize(640, 320, {fit: 'cover', position: 'top'})
|
||||
.png()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue