mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-30 06:50:36 +02:00
feat(v2): optimize image processing with sharp & lqip (#1663)
* feat(v2): optimize image processing * cleanup
This commit is contained in:
parent
f77e96d28d
commit
bc5bceeb87
15 changed files with 838 additions and 33 deletions
|
@ -9,6 +9,7 @@ import React from 'react';
|
|||
import Link from '@docusaurus/Link';
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||
import withBaseUrl from '@docusaurus/withBaseUrl';
|
||||
import Image from '@docusaurus/Image';
|
||||
|
||||
import Layout from '@theme/Layout';
|
||||
|
||||
|
@ -18,7 +19,7 @@ import styles from './styles.module.css';
|
|||
|
||||
const QUOTES = [
|
||||
{
|
||||
thumbnail: 'img/christopher-chedeau.jpg',
|
||||
thumbnail: require('./christopher-chedeau.jpg'),
|
||||
name: 'Christopher "vjeux" Chedeau',
|
||||
title: 'Lead Prettier Developer',
|
||||
text: (
|
||||
|
@ -34,7 +35,7 @@ const QUOTES = [
|
|||
),
|
||||
},
|
||||
{
|
||||
thumbnail: 'img/hector-ramos.png',
|
||||
thumbnail: require('./hector-ramos.png'),
|
||||
name: 'Hector Ramos',
|
||||
title: 'Lead React Native Advocate',
|
||||
text: (
|
||||
|
@ -47,7 +48,7 @@ const QUOTES = [
|
|||
),
|
||||
},
|
||||
{
|
||||
thumbnail: 'img/ricky-vetter.jpg',
|
||||
thumbnail: require('./ricky-vetter.jpg'),
|
||||
name: 'Ricky Vetter',
|
||||
title: 'ReasonReact Developer',
|
||||
text: (
|
||||
|
@ -197,10 +198,10 @@ function Home() {
|
|||
{QUOTES.map(quote => (
|
||||
<div className="col" key={quote.name}>
|
||||
<div className="avatar avatar--vertical margin-bottom--sm">
|
||||
<img
|
||||
<Image
|
||||
alt={quote.name}
|
||||
className="avatar__photo avatar__photo--xl"
|
||||
src={withBaseUrl(quote.thumbnail)}
|
||||
img={quote.thumbnail}
|
||||
/>
|
||||
<div className="avatar__intro">
|
||||
<h4 className="avatar__name">{quote.name}</h4>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue