mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
docs: Add kwatch to showcase (#6281)
* Add kwatch to showcase * remove trailing whitespace in description * fix preview extension * resize Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
parent
06a8cdcb0f
commit
32a24e4edd
3 changed files with 12 additions and 1 deletions
|
@ -10,10 +10,13 @@ import sharp from 'sharp';
|
|||
import fs from 'fs/promises';
|
||||
import path from 'path';
|
||||
|
||||
const images = (
|
||||
const allImages = (
|
||||
await fs.readdir(new URL('../../website/src/data/showcase', import.meta.url))
|
||||
).filter((file) => ['.png', 'jpg', '.jpeg'].includes(path.extname(file)));
|
||||
|
||||
const [,,...selectedImages] = process.argv;
|
||||
const images = selectedImages.length > 0 ? selectedImages : allImages;
|
||||
|
||||
await Promise.all(
|
||||
images.map(async (img) => {
|
||||
const imgPath = new URL(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue