diff options
| author | shu <nvcsadjkojf@outlook.com> | 2026-09-05 21:00:19 +0800 |
|---|---|---|
| committer | shu <nvcsadjkojf@outlook.com> | 2026-09-05 21:00:19 +0800 |
| commit | efb449041e030c8d9ec06a4f4cfbf5554c868a93 (patch) | |
| tree | fb9bdd23a9c4a71d54daa2b5a854a6e5082063f3 /src | |
init commit
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/HomepageFeatures/index.tsx | 71 | ||||
| -rw-r--r-- | src/components/HomepageFeatures/styles.module.css | 11 | ||||
| -rw-r--r-- | src/css/custom.css | 30 | ||||
| -rw-r--r-- | src/pages/_index.tsx | 44 | ||||
| -rw-r--r-- | src/pages/index.module.css | 23 | ||||
| -rw-r--r-- | src/pages/markdown-page.mdx | 8 |
6 files changed, 187 insertions, 0 deletions
diff --git a/src/components/HomepageFeatures/index.tsx b/src/components/HomepageFeatures/index.tsx new file mode 100644 index 0000000..c2551fb --- /dev/null +++ b/src/components/HomepageFeatures/index.tsx @@ -0,0 +1,71 @@ +import type {ReactNode} from 'react'; +import clsx from 'clsx'; +import Heading from '@theme/Heading'; +import styles from './styles.module.css'; + +type FeatureItem = { + title: string; + Svg: React.ComponentType<React.ComponentProps<'svg'>>; + description: ReactNode; +}; + +const FeatureList: FeatureItem[] = [ + { + title: 'Easy to Use', + Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, + description: ( + <> + Docusaurus was designed from the ground up to be easily installed and + used to get your website up and running quickly. + </> + ), + }, + { + title: 'Focus on What Matters', + Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default, + description: ( + <> + Docusaurus lets you focus on your docs, and we'll do the chores. Go + ahead and move your docs into the <code>docs</code> directory. + </> + ), + }, + { + title: 'Powered by React', + Svg: require('@site/static/img/undraw_docusaurus_react.svg').default, + description: ( + <> + Extend or customize your website layout by reusing React. Docusaurus can + be extended while reusing the same header and footer. + </> + ), + }, +]; + +function Feature({title, Svg, description}: FeatureItem) { + return ( + <div className={clsx('col col--4')}> + <div className="text--center"> + <Svg className={styles.featureSvg} role="img" /> + </div> + <div className="text--center padding-horiz--md"> + <Heading as="h3">{title}</Heading> + <p>{description}</p> + </div> + </div> + ); +} + +export default function HomepageFeatures(): ReactNode { + return ( + <section className={styles.features}> + <div className="container"> + <div className="row"> + {FeatureList.map((props, idx) => ( + <Feature key={idx} {...props} /> + ))} + </div> + </div> + </section> + ); +} diff --git a/src/components/HomepageFeatures/styles.module.css b/src/components/HomepageFeatures/styles.module.css new file mode 100644 index 0000000..b248eb2 --- /dev/null +++ b/src/components/HomepageFeatures/styles.module.css @@ -0,0 +1,11 @@ +.features { + display: flex; + align-items: center; + padding: 2rem 0; + width: 100%; +} + +.featureSvg { + height: 200px; + width: 200px; +} diff --git a/src/css/custom.css b/src/css/custom.css new file mode 100644 index 0000000..2bc6a4c --- /dev/null +++ b/src/css/custom.css @@ -0,0 +1,30 @@ +/** + * Any CSS included here will be global. The classic template + * bundles Infima by default. Infima is a CSS framework designed to + * work well for content-centric websites. + */ + +/* You can override the default Infima variables here. */ +:root { + --ifm-color-primary: #2e8555; + --ifm-color-primary-dark: #29784c; + --ifm-color-primary-darker: #277148; + --ifm-color-primary-darkest: #205d3b; + --ifm-color-primary-light: #33925d; + --ifm-color-primary-lighter: #359962; + --ifm-color-primary-lightest: #3cad6e; + --ifm-code-font-size: 95%; + --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); +} + +/* For readability concerns, you should choose a lighter palette in dark mode. */ +[data-theme='dark'] { + --ifm-color-primary: #25c2a0; + --ifm-color-primary-dark: #21af90; + --ifm-color-primary-darker: #1fa588; + --ifm-color-primary-darkest: #1a8870; + --ifm-color-primary-light: #29d5b0; + --ifm-color-primary-lighter: #32d8b4; + --ifm-color-primary-lightest: #4fddbf; + --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); +} diff --git a/src/pages/_index.tsx b/src/pages/_index.tsx new file mode 100644 index 0000000..2e006d1 --- /dev/null +++ b/src/pages/_index.tsx @@ -0,0 +1,44 @@ +import type {ReactNode} from 'react'; +import clsx from 'clsx'; +import Link from '@docusaurus/Link'; +import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; +import Layout from '@theme/Layout'; +import HomepageFeatures from '@site/src/components/HomepageFeatures'; +import Heading from '@theme/Heading'; + +import styles from './index.module.css'; + +function HomepageHeader() { + const {siteConfig} = useDocusaurusContext(); + return ( + <header className={clsx('hero hero--primary', styles.heroBanner)}> + <div className="container"> + <Heading as="h1" className="hero__title"> + {siteConfig.title} + </Heading> + <p className="hero__subtitle">{siteConfig.tagline}</p> + <div className={styles.buttons}> + <Link + className="button button--secondary button--lg" + to="/docs/intro"> + Docusaurus Tutorial - 5min ⏱️ + </Link> + </div> + </div> + </header> + ); +} + +export default function Home(): ReactNode { + const {siteConfig} = useDocusaurusContext(); + return ( + <Layout + title={`Hello from ${siteConfig.title}`} + description="Description will go into a meta tag in <head />"> + <HomepageHeader /> + <main> + <HomepageFeatures /> + </main> + </Layout> + ); +} diff --git a/src/pages/index.module.css b/src/pages/index.module.css new file mode 100644 index 0000000..9f71a5d --- /dev/null +++ b/src/pages/index.module.css @@ -0,0 +1,23 @@ +/** + * CSS files with the .module.css suffix will be treated as CSS modules + * and scoped locally. + */ + +.heroBanner { + padding: 4rem 0; + text-align: center; + position: relative; + overflow: hidden; +} + +@media screen and (max-width: 996px) { + .heroBanner { + padding: 2rem; + } +} + +.buttons { + display: flex; + align-items: center; + justify-content: center; +} diff --git a/src/pages/markdown-page.mdx b/src/pages/markdown-page.mdx new file mode 100644 index 0000000..ffc8c39 --- /dev/null +++ b/src/pages/markdown-page.mdx @@ -0,0 +1,8 @@ +--- +title: Markdown page example +--- + +# Markdown page example + +You don't need React to write simple standalone pages. + |
