mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-30 10:48:05 +02:00
fix(create-docusaurus): add useBaseUrl for image URLs (#6368)
This is already provided by the classic template and in TypeScript template wasn't updated.
This commit is contained in:
parent
9c4187a5b9
commit
dd63a72a71
2 changed files with 12 additions and 2 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import styles from './HomepageFeatures.module.css';
|
import styles from './HomepageFeatures.module.css';
|
||||||
|
@ -45,7 +46,11 @@ function Feature({title, image, description}: FeatureItem) {
|
||||||
return (
|
return (
|
||||||
<div className={clsx('col col--4')}>
|
<div className={clsx('col col--4')}>
|
||||||
<div className="text--center">
|
<div className="text--center">
|
||||||
<img className={styles.featureSvg} alt={title} src={image} />
|
<img
|
||||||
|
className={styles.featureSvg}
|
||||||
|
alt={title}
|
||||||
|
src={useBaseUrl(image)}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="text--center padding-horiz--md">
|
<div className="text--center padding-horiz--md">
|
||||||
<h3>{title}</h3>
|
<h3>{title}</h3>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import styles from './HomepageFeatures.module.css';
|
import styles from './HomepageFeatures.module.css';
|
||||||
|
@ -45,7 +46,11 @@ function Feature({title, image, description}: FeatureItem) {
|
||||||
return (
|
return (
|
||||||
<div className={clsx('col col--4')}>
|
<div className={clsx('col col--4')}>
|
||||||
<div className="text--center">
|
<div className="text--center">
|
||||||
<img className={styles.featureSvg} alt={title} src={image} />
|
<img
|
||||||
|
className={styles.featureSvg}
|
||||||
|
alt={title}
|
||||||
|
src={useBaseUrl(image)}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="text--center padding-horiz--md">
|
<div className="text--center padding-horiz--md">
|
||||||
<h3>{title}</h3>
|
<h3>{title}</h3>
|
||||||
|
|
Loading…
Add table
Reference in a new issue