From c000234fb38d14aef6c29a64a9b181e981cf6507 Mon Sep 17 00:00:00 2001 From: Igor Pokryshevskiy Date: Fri, 13 Sep 2024 13:27:40 -0400 Subject: [PATCH] Add "Start from template" step under CLI -> Get Started (#590) * add "Start from template" step under CLI -> Get Started * update content and wording * editorial fixes, update github code link, add callout backlink to templates --- apps/nextra/pages/en/build/cli/_meta.tsx | 3 ++ .../en/build/cli/start-from-template.mdx | 42 +++++++++++++++++++ .../build/smart-contracts/create-package.mdx | 14 ++++--- 3 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 apps/nextra/pages/en/build/cli/start-from-template.mdx diff --git a/apps/nextra/pages/en/build/cli/_meta.tsx b/apps/nextra/pages/en/build/cli/_meta.tsx index bdd3856ab..831531a94 100644 --- a/apps/nextra/pages/en/build/cli/_meta.tsx +++ b/apps/nextra/pages/en/build/cli/_meta.tsx @@ -9,6 +9,9 @@ export default { "setup-cli": { title: "Setup", }, + "start-from-template": { + title: "Start from template", + }, "---usage---": { type: "separator", title: "Usage", diff --git a/apps/nextra/pages/en/build/cli/start-from-template.mdx b/apps/nextra/pages/en/build/cli/start-from-template.mdx new file mode 100644 index 000000000..60ffbd5c6 --- /dev/null +++ b/apps/nextra/pages/en/build/cli/start-from-template.mdx @@ -0,0 +1,42 @@ +import { Card, RemoteCodeblock, permalinkFetch } from '@components/index'; +import { Steps } from "nextra/components" + +export async function getStaticProps() { + return await permalinkFetch([ + "https://github.com/aptos-labs/aptos-core/blob/afd3706c17bcccfb39a9d6059aecbfa648ed295d/aptos-move/move-examples/hello_blockchain/sources/hello_blockchain.move#L1-L64" + ]) +} + +# Start a Move package from a template +Follow the steps below to quickly get started. + + + ### Initialize + Run the following to initialize a package using the `hello-blockchain` template: + ```bash filename="Terminal" + aptos move init --name hello_blockchain --template hello-blockchain + ``` + + ### Start building + The template creates a `hello_blockchain.move` file under `sources` to help get you started. + + + ### See all templates + Run the following command to see all templates (and for general help initializing a package): + ```bash + aptos move init --help + ``` + + ### Learn More + + Smart Contracts + Learn how to build in Move + + + Create Package + Get started by learning how to create a Move package + + + diff --git a/apps/nextra/pages/en/build/smart-contracts/create-package.mdx b/apps/nextra/pages/en/build/smart-contracts/create-package.mdx index 793405779..3b44b4dd6 100644 --- a/apps/nextra/pages/en/build/smart-contracts/create-package.mdx +++ b/apps/nextra/pages/en/build/smart-contracts/create-package.mdx @@ -7,14 +7,14 @@ import { RemoteCodeblock, permalinkFetch } from '@components/index'; export async function getStaticProps() { return await permalinkFetch([ - 'https://github.com/aptos-labs/aptos-core/blob/77e1d222ebc5e7294e115e0d090c001da1d0e072/aptos-move/move-examples/hello_blockchain/sources/hello_blockchain.move#L1-L59' + 'https://github.com/aptos-labs/aptos-core/blob/afd3706c17bcccfb39a9d6059aecbfa648ed295d/aptos-move/move-examples/hello_blockchain/sources/hello_blockchain.move#L1-L64' ]) } # Create Package -We recommend installing the Aptos CLI before beginning. +We recommend installing the Aptos CLI before beginning. If you haven't already installed the Aptos CLI, see the [CLI section](../cli) @@ -37,6 +37,10 @@ You should now have a Move project that looks like so: + + You can also create a Move package from a [template](../cli/start-from-template). + + ### Update `Move.toml` In `Move.toml`, fill in the following key information: @@ -66,8 +70,8 @@ subdir = "aptos-move/framework/aptos-framework" Add your code in the `sources` directory. Here we have a `hello_blockchain.move` example. - - \ No newline at end of file +