Skip to content

Commit

Permalink
refactor(init): promote good practices; use site alias (#6481)
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena authored Jan 27, 2022
1 parent f415da1 commit 4c22316
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 17 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import useBaseUrl from '@docusaurus/useBaseUrl';
import React from 'react';
import clsx from 'clsx';
import styles from './HomepageFeatures.module.css';
import styles from './styles.module.css';

type FeatureItem = {
title: string;
Expand All @@ -12,7 +11,7 @@ type FeatureItem = {
const FeatureList: FeatureItem[] = [
{
title: 'Easy to Use',
image: '/img/undraw_docusaurus_mountain.svg',
image: require('@site/src/static/img/undraw_docusaurus_mountain.svg'),
description: (
<>
Docusaurus was designed from the ground up to be easily installed and
Expand All @@ -22,7 +21,7 @@ const FeatureList: FeatureItem[] = [
},
{
title: 'Focus on What Matters',
image: '/img/undraw_docusaurus_tree.svg',
image: require('@site/src/static/img/undraw_docusaurus_tree.svg'),
description: (
<>
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
Expand All @@ -32,7 +31,7 @@ const FeatureList: FeatureItem[] = [
},
{
title: 'Powered by React',
image: '/img/undraw_docusaurus_react.svg',
image: require('@site/src/static/img/undraw_docusaurus_react.svg'),
description: (
<>
Extend or customize your website layout by reusing React. Docusaurus can
Expand All @@ -46,11 +45,7 @@ function Feature({title, image, description}: FeatureItem) {
return (
<div className={clsx('col col--4')}>
<div className="text--center">
<img
className={styles.featureSvg}
alt={title}
src={useBaseUrl(image)}
/>
<img className={styles.featureSvg} alt={title} src={image} />
</div>
<div className="text--center padding-horiz--md">
<h3>{title}</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import styles from './index.module.css';
import HomepageFeatures from '../components/HomepageFeatures';
import HomepageFeatures from '@site/src/components/HomepageFeatures';

function HomepageHeader() {
const {siteConfig} = useDocusaurusContext();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import clsx from 'clsx';
import styles from './HomepageFeatures.module.css';
import styles from './styles.module.css';

const FeatureList = [
{
title: 'Easy to Use',
Svg: require('../../static/img/undraw_docusaurus_mountain.svg').default,
Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default,
description: (
<>
Docusaurus was designed from the ground up to be easily installed and
Expand All @@ -15,7 +15,7 @@ const FeatureList = [
},
{
title: 'Focus on What Matters',
Svg: require('../../static/img/undraw_docusaurus_tree.svg').default,
Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default,
description: (
<>
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
Expand All @@ -25,7 +25,7 @@ const FeatureList = [
},
{
title: 'Powered by React',
Svg: require('../../static/img/undraw_docusaurus_react.svg').default,
Svg: require('@site/static/img/undraw_docusaurus_react.svg').default,
description: (
<>
Extend or customize your website layout by reusing React. Docusaurus can
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import styles from './index.module.css';
import HomepageFeatures from '../components/HomepageFeatures';
import HomepageFeatures from '@site/src/components/HomepageFeatures';

function HomepageHeader() {
const {siteConfig} = useDocusaurusContext();
Expand Down

0 comments on commit 4c22316

Please sign in to comment.