From a4d2f1d83c63dabc3d6186f0a761eb1954a1cc74 Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Tue, 26 Mar 2024 10:59:23 -0500 Subject: [PATCH] add redirects for tutorials --- docs/tutorials/README.mdx | 10 ++++++++++ nginx/includes/redirects.conf | 13 +++++++------ src/sidebar-generator.js | 2 +- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/tutorials/README.mdx b/docs/tutorials/README.mdx index ba319b52..f03a4754 100644 --- a/docs/tutorials/README.mdx +++ b/docs/tutorials/README.mdx @@ -1,10 +1,20 @@ --- title: Tutorials hide_table_of_contents: true +sidebar_custom_props: + migration: + href: https://developers.stellar.org/docs/smart-contracts/example-contracts + label: Tutorials --- import DocCardList from "@theme/DocCardList"; +:::danger These are not the droids you're looking for + +This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/smart-contracts/example-contracts) for the most up-to-date information + +::: + The Soroban team has put together a large collection of [example contracts] to demonstrate use of the Soroban smart contracts platform. For many of these example contracts, we've written an accompanying "tutorial" that will walk you through the example contracts and describe a bit more about their design. You can think of these "tutorials" as example contracts that end with a deployable smart contract. You can use the provided filters to find a relevant tutorial for your experience level. diff --git a/nginx/includes/redirects.conf b/nginx/includes/redirects.conf index 6bc9a4ef..df67e4a3 100644 --- a/nginx/includes/redirects.conf +++ b/nginx/includes/redirects.conf @@ -1,11 +1,11 @@ -rewrite "^/docs/category/examples$" "/docs/tutorials" permanent; +rewrite "^/docs/category/examples$" "https://developers.stellar.org/docs/smart-contracts/example-contracts" permanent; rewrite "^/docs/getting-started/run-rpc$" "https://developers.stellar.org/network/soroban-rpc/admin-guide" permanent; -rewrite "^/docs/category/tutorials$" "/docs/tutorials" permanent; +rewrite "^/docs/category/tutorials$" "https://developers.stellar.org/docs/smart-contracts/example-contracts" permanent; rewrite "^/docs/tutorials/deploy-to-futurenet$" "/docs/getting-started/deploy-to-testnet" permanent; rewrite "^/fundamentals-and-concepts/faq$" "/docs/faq" permanent; -rewrite "^/docs/examples/events$" "/docs/tutorials/events" permanent; +rewrite "^/docs/examples/events$" "https://developers.stellar.org/docs/smart-contracts/example-contracts/events" permanent; rewrite "^/docs/learn/rust-dialect$" "https://developers.stellar.org/docs/learn/smart-contract-internals/rust-dialect" permanent; -rewrite "^/docs/advanced-tutorials/liquidity-pool-b6f$" "/docs/tutorials/liquidity-pool" permanent; +rewrite "^/docs/advanced-tutorials/liquidity-pool-b6f$" "https://developers.stellar.org/docs/smart-contracts/example-contracts/liquidity-pool" permanent; rewrite "^/docs(/category)?/learn$" "https://developers.stellar.org/docs/learn/smart-contract-internals" permanent; rewrite "^/docs/category/fundamentals-and-concepts$" "https://developers.stellar.org/docs/learn/smart-contract-internals" permanent; rewrite "^/docs/built-in-contracts/token$" "/docs/tokens/stellar-asset-contract" permanent; @@ -15,7 +15,7 @@ rewrite "^/docs/tutorials/testing$" "https://developers.stellar.org/docs/learn/s rewrite "^/docs/category/how-to-guides$" "/docs/guides" permanent; rewrite "^/docs/getting-started/connect-freighter-wallet$" "/docs/reference/freighter" permanent; rewrite "^/docs/common-interfaces/token$" "/docs/tokens/token-interface" permanent; -rewrite "^/docs/how-to-guides/tokens$" "/docs/tutorials/tokens" permanent; +rewrite "^/docs/how-to-guides/tokens$" "https://developers.stellar.org/docs/smart-contracts/example-contracts/tokens" permanent; rewrite "^/dapps/category/challenges$" "/dashboard" permanent; rewrite "^/docs/guides/cli/wrap-token$" "/docs/guides/cli/deploy-stellar-asset-contract" permanent; # BEGIN re-structure redirects @@ -32,7 +32,7 @@ rewrite "^/docs/fundamentals-and-concepts/(built-in-types|custom-types|fully-typ rewrite "^/docs/fundamentals-and-concepts/invoking-contracts-with-transactions$" "https://developers.stellar.org/docs/learn/smart-contract-internals/contract-interactions/stellar-transaction" permanent; rewrite "^/docs/soroban-internals/contract-interactions/stellar-transactions$" "https://developers.stellar.org/docs/learn/smart-contract-internals/contract-interactions/stellar-transaction" permanent; rewrite "^/docs/fundamentals-and-concepts/interacting-with-contracts$" "https://developers.stellar.org/docs/learn/smart-contract-internals/contract-interactions" permanent; -rewrite "^/docs/(basic|advanced)-tutorials(/.*)$" "/docs/tutorials$2" permanent; +rewrite "^/docs/(basic|advanced)-tutorials(/.*)$" "https://developers.stellar.org/docs/smart-contracts/example-contracts$2" permanent; rewrite "^/docs/fundamentals-and-concepts(/.*)$" "https://developers.stellar.org/docs/learn/smart-contract-internals$1" permanent; rewrite "^/docs/notes" "https://developers.stellar.org/meetings" permanent; ##### BEGIN merge redirects @@ -65,3 +65,4 @@ rewrite "^/docs/soroban-internals(.*)$" "https://developers.stellar.org/docs/lea rewrite "^/docs/migrate(.*)$" "https://developers.stellar.org/docs/learn/migrate$1" permanent; # smart contracts rewrite "^/docs/guides(.*)$" "https://developers.stellar.org/docs/smart-contracts/guides$1" permanent; +rewrite "^/docs/tutorials(.*)$" "https://developers.stellar.org/docs/smart-contracts/example-contracts$1" permanent; diff --git a/src/sidebar-generator.js b/src/sidebar-generator.js index f311c086..9404f7d5 100644 --- a/src/sidebar-generator.js +++ b/src/sidebar-generator.js @@ -4,7 +4,7 @@ const path = require('path') const migrationLinksRecursive = (sidebarItems) => { const result = sidebarItems.map((sidebarItem) => { if (sidebarItem.type === 'category') { - if (sidebarItem.label === 'How-To Guides') { + if (sidebarItem.label === 'How-To Guides' || sidebarItem.label === 'Tutorials') { return { type: 'link', href: sidebarItem.customProps.migration.href,