|
1 | | -import React from 'react'; |
2 | | -import clsx from 'clsx'; |
3 | | -import Layout from '@theme/Layout'; |
4 | | -import Link from '@docusaurus/Link'; |
5 | | -import CodeBlock from '@theme/CodeBlock'; |
6 | | -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; |
7 | | -import styles from './index.module.css'; |
8 | | - |
9 | | -function Hero() { |
10 | | - return ( |
11 | | - <header className={clsx('container', styles.heroBanner)}> |
12 | | - <div className="row padding-horiz--md"> |
13 | | - <div className="col col--7"> |
14 | | - <div className={clsx(styles.relative, 'row')}> |
15 | | - <div className="col"> |
16 | | - <h1 className={styles.tagline}> |
17 | | - Apify command-line interface (CLI) |
18 | | - </h1> |
19 | | - </div> |
20 | | - </div> |
21 | | - <div className="row"> |
22 | | - <div className="col"> |
23 | | - <h2></h2> |
24 | | - <h2> |
25 | | - Create, develop, build, and run <a href="https://docs.apify.com/actors">Apify Actors</a> from |
26 | | - your terminal. Manage the Apify platform from shell scripts. |
27 | | - </h2> |
28 | | - </div> |
29 | | - </div> |
30 | | - <div className="row"> |
31 | | - <div className="col"> |
32 | | - <div className={styles.heroButtons}> |
33 | | - <Link to="/docs" className={styles.getStarted}>Learn more</Link> |
34 | | - <iframe src="https://ghbtns.com/github-btn.html?user=apify&repo=apify-cli&type=star&count=true&size=large" frameBorder="0" scrolling="0" width="170" height="30" title="GitHub"></iframe> |
35 | | - </div> |
36 | | - </div> |
37 | | - </div> |
38 | | - </div> |
39 | | - <div className={clsx(styles.relative, 'col', 'col--5')}> |
40 | | - <div className={styles.logoBlur}> |
41 | | - <img src={require('/img/logo-blur.png').default} className={clsx(styles.hideSmall)} /> |
42 | | - </div> |
43 | | - <div className={styles.codeBlock}> |
44 | | - <CodeBlock className="language-bash"> |
45 | | - npm i -g apify-cli |
46 | | - </CodeBlock> |
47 | | - </div> |
48 | | - </div> |
49 | | - </div> |
50 | | - </header> |
51 | | - ); |
52 | | -} |
| 1 | +import { useEffect } from 'react'; |
| 2 | +import { useHistory } from '@docusaurus/router'; |
53 | 3 |
|
54 | 4 | export default function Home() { |
55 | | - const { siteConfig } = useDocusaurusContext(); |
56 | | - return ( |
57 | | - <Layout |
58 | | - description={siteConfig.description}> |
59 | | - <Hero /> |
60 | | - <div> |
61 | | - <div className="container"> |
62 | | - <div className="row padding-horiz--md" > |
63 | | - <div className="col col--6"> |
64 | | - <p style={{ lineHeight: '200%' }}> |
65 | | - Apify Actors are cloud programs that can perform arbitrary web scraping, |
66 | | - automation, or data processing job. They accept input, perform their job and generate output. |
67 | | - </p> |
68 | | - <p style={{ lineHeight: '200%' }}> |
69 | | - While you can develop Actors in an online IDE in <a href="https://console.apify.com/">Apify Console</a>, for |
70 | | - larger projects, it is more convenient to develop Actors locally on your computer |
71 | | - using <a href="https://docs.apify.com/sdk/js/">Apify SDK</a> and only push the Actors |
72 | | - to the Apify platform during deployment. This is where the Apify CLI comes in to allow you to quickly develop |
73 | | - locally and then deploy to the cloud with a single command. |
74 | | - </p> |
75 | | - </div> |
76 | | - <div className="col col--6"> |
77 | | - <CodeBlock language='bash'>{`# Create your first Actor |
78 | | -apify create my-actor |
79 | | -
|
80 | | -# Go into the project directory |
81 | | -cd my-actor |
| 5 | + const history = useHistory(); |
82 | 6 |
|
83 | | -# Run it locally |
84 | | -apify run |
| 7 | + useEffect(() => { |
| 8 | + history.replace('/cli/docs'); |
| 9 | + }, [history]); |
85 | 10 |
|
86 | | -# Log into your Apify account and deploy it to Apify Platform |
87 | | -apify login |
88 | | -apify push`}</CodeBlock> |
89 | | - </div> |
90 | | - </div> |
91 | | - </div> |
92 | | - </div> |
93 | | - </Layout> |
94 | | - ); |
| 11 | + return null; |
95 | 12 | } |
0 commit comments