mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-15 18:17:35 +02:00
docs: update Evan Tay personal site showcase (#6855)
* docs: update evantay showcase image * docs: update evnatay showcase title * fix test * retake photo Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
parent
4db0c620de
commit
edb4d00096
4 changed files with 7 additions and 5 deletions
|
@ -12,6 +12,7 @@ import fs from 'fs-extra';
|
|||
import path from 'path';
|
||||
import imageSize from 'image-size';
|
||||
import {fileURLToPath} from 'url';
|
||||
import logger from '@docusaurus/logger';
|
||||
|
||||
const allImages = (
|
||||
await fs.readdir(new URL('../../website/src/data/showcase', import.meta.url))
|
||||
|
@ -27,10 +28,11 @@ await Promise.all(
|
|||
);
|
||||
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
|
||||
// Do not emit if not resized. Important because we can't guarantee
|
||||
// idempotency during resize -> optimization
|
||||
return;
|
||||
}
|
||||
logger.info`Resized path=${imgPath}: Before number=${width}×number=${height}`;
|
||||
const data = await sharp(imgPath)
|
||||
.resize(640, 320, {fit: 'cover', position: 'top'})
|
||||
.png()
|
||||
|
|
|
@ -27,11 +27,11 @@ expect.extend({
|
|||
toHaveGoodDimensions({width, height}: {width: number; height: number}) {
|
||||
// Put this one first because aspect ratio is harder to fix than resizing
|
||||
// (need to take another screenshot)
|
||||
if (width / height < 0.5) {
|
||||
if (width / height > 2) {
|
||||
return {
|
||||
pass: false,
|
||||
message: () =>
|
||||
`The preview image's width is ${width} and height is ${height}. To make sure it takes up the entire container in our showcase card, it needs to have a minimum aspect ratio of 2:1. Please make your image taller.`,
|
||||
`The preview image's width is ${width} and height is ${height}. To make sure it takes up the entire container in our showcase card, it needs to have an aspect ratio of no wider than 2:1. Please make your image taller.`,
|
||||
};
|
||||
} else if (width < 640) {
|
||||
return {
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 17 KiB |
|
@ -559,7 +559,7 @@ const Users: User[] = [
|
|||
tags: ['opensource', 'personal', 'i18n'],
|
||||
},
|
||||
{
|
||||
title: "Evan Tay's Personal Website",
|
||||
title: "KayaFolio",
|
||||
description:
|
||||
"A Software Engineer's blog, documentation and project portfolio.",
|
||||
preview: require('./showcase/evantay.png'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue