From 607da74d23c0e72207b4102db3c5a46d1c104029 Mon Sep 17 00:00:00 2001 From: Jonathon Hammond Date: Wed, 9 Mar 2022 13:28:11 -0500 Subject: [PATCH] sub folder revert, fix for URL index 404 --- next.config.js | 10 +++++++++ src/common/routes/get-routes.js | 3 ++- src/pages/{404/index.md => en/404.md} | 0 .../{api/status/index.js => en/api/status.js} | 0 .../index.md => en/build-apps/overview.md} | 0 .../build-apps/references/authentication.md} | 0 .../build-apps/references/bns.md} | 0 .../build-apps/references/gaia.md} | 0 .../index.md => en/contributing.md} | 0 src/pages/{ => en}/index.md | 0 .../references/bns-contract.md} | 0 .../index.md => en/references/deploy-tips.md} | 0 .../faqs/index.md => en/references/faqs.md} | 0 .../index.md => en/references/glossary.md} | 0 .../references/language-functions.md} | 0 .../references/language-keywords.md} | 0 .../references/language-overview.md} | 0 .../references/language-types.md} | 0 .../references/stacking-contract.md} | 0 .../references/stacks-node-configuration.md} | 0 .../index.md => en/start-mining/mainnet.md} | 0 .../index.md => en/start-mining/testnet.md} | 0 .../understand-stacks/accounts.md} | 0 .../understand-stacks/microblocks.md} | 0 .../understand-stacks/mining.md} | 0 .../understand-stacks/network.md} | 0 .../understand-stacks/overview.md} | 0 .../understand-stacks/proof-of-transfer.md} | 0 .../running-mainnet-node.md} | 0 .../running-testnet-node.md} | 0 .../understand-stacks/stacking.md} | 0 .../stacks-blockchain-api.md} | 0 .../understand-stacks/technical-specs.md} | 0 .../understand-stacks/testnet.md} | 0 .../understand-stacks/transactions.md} | 0 .../write-smart-contracts/overview.md} | 0 .../write-smart-contracts/principals.md} | 0 .../write-smart-contracts/tokens.md} | 0 .../write-smart-contracts/values.md} | 0 src/pages/index/index.md | 21 ------------------- 40 files changed, 12 insertions(+), 22 deletions(-) rename src/pages/{404/index.md => en/404.md} (100%) rename src/pages/{api/status/index.js => en/api/status.js} (100%) rename src/pages/{build-apps/overview/index.md => en/build-apps/overview.md} (100%) rename src/pages/{build-apps/references/authentication/index.md => en/build-apps/references/authentication.md} (100%) rename src/pages/{build-apps/references/bns/index.md => en/build-apps/references/bns.md} (100%) rename src/pages/{build-apps/references/gaia/index.md => en/build-apps/references/gaia.md} (100%) rename src/pages/{contributing/index.md => en/contributing.md} (100%) rename src/pages/{ => en}/index.md (100%) rename src/pages/{references/bns-contract/index.md => en/references/bns-contract.md} (100%) rename src/pages/{references/deploy-tips/index.md => en/references/deploy-tips.md} (100%) rename src/pages/{references/faqs/index.md => en/references/faqs.md} (100%) rename src/pages/{references/glossary/index.md => en/references/glossary.md} (100%) rename src/pages/{references/language-functions/index.md => en/references/language-functions.md} (100%) rename src/pages/{references/language-keywords/index.md => en/references/language-keywords.md} (100%) rename src/pages/{references/language-overview/index.md => en/references/language-overview.md} (100%) rename src/pages/{references/language-types/index.md => en/references/language-types.md} (100%) rename src/pages/{references/stacking-contract/index.md => en/references/stacking-contract.md} (100%) rename src/pages/{references/stacks-node-configuration/index.md => en/references/stacks-node-configuration.md} (100%) rename src/pages/{start-mining/mainnet/index.md => en/start-mining/mainnet.md} (100%) rename src/pages/{start-mining/testnet/index.md => en/start-mining/testnet.md} (100%) rename src/pages/{understand-stacks/accounts/index.md => en/understand-stacks/accounts.md} (100%) rename src/pages/{understand-stacks/microblocks/index.md => en/understand-stacks/microblocks.md} (100%) rename src/pages/{understand-stacks/mining/index.md => en/understand-stacks/mining.md} (100%) rename src/pages/{understand-stacks/network/index.md => en/understand-stacks/network.md} (100%) rename src/pages/{understand-stacks/overview/index.md => en/understand-stacks/overview.md} (100%) rename src/pages/{understand-stacks/proof-of-transfer/index.md => en/understand-stacks/proof-of-transfer.md} (100%) rename src/pages/{understand-stacks/running-mainnet-node/index.md => en/understand-stacks/running-mainnet-node.md} (100%) rename src/pages/{understand-stacks/running-testnet-node/index.md => en/understand-stacks/running-testnet-node.md} (100%) rename src/pages/{understand-stacks/stacking/index.md => en/understand-stacks/stacking.md} (100%) rename src/pages/{understand-stacks/stacks-blockchain-api/index.md => en/understand-stacks/stacks-blockchain-api.md} (100%) rename src/pages/{understand-stacks/technical-specs/index.md => en/understand-stacks/technical-specs.md} (100%) rename src/pages/{understand-stacks/testnet/index.md => en/understand-stacks/testnet.md} (100%) rename src/pages/{understand-stacks/transactions/index.md => en/understand-stacks/transactions.md} (100%) rename src/pages/{write-smart-contracts/overview/index.md => en/write-smart-contracts/overview.md} (100%) rename src/pages/{write-smart-contracts/principals/index.md => en/write-smart-contracts/principals.md} (100%) rename src/pages/{write-smart-contracts/tokens/index.md => en/write-smart-contracts/tokens.md} (100%) rename src/pages/{write-smart-contracts/values/index.md => en/write-smart-contracts/values.md} (100%) delete mode 100644 src/pages/index/index.md diff --git a/next.config.js b/next.config.js index 5e6cdef5..7ffd2ec7 100755 --- a/next.config.js +++ b/next.config.js @@ -935,6 +935,15 @@ async function redirects() { ]; } +async function rewrites() { + return [ + { + source: '/:path*', + destination: '/en/:path*', + }, + ]; +} + module.exports = withFonts( withBundleAnalyzer({ experimental: { @@ -947,6 +956,7 @@ module.exports = withFonts( FATHOM_ID: 'FOEMPXUV', }, redirects, + rewrites, pageExtensions: ['js', 'ts', 'tsx', 'md', 'mdx'], webpack: (config, options) => { config.module.rules.push({ diff --git a/src/common/routes/get-routes.js b/src/common/routes/get-routes.js index 861c0ffa..4d3ee0be 100644 --- a/src/common/routes/get-routes.js +++ b/src/common/routes/get-routes.js @@ -68,8 +68,9 @@ const routes = allRoutes.map(route => { // detect the locale // index.${locale}.md try { + console.log('JONATHON', route); const fileContent = fs.readFileSync( - path.join('./src/pages', `${route === '/' ? 'index' : route}/index.md`), + path.join('./src/pages/en', `${route === '/' ? 'index' : route}.md`), 'utf8' ); const data = fm(fileContent); diff --git a/src/pages/404/index.md b/src/pages/en/404.md similarity index 100% rename from src/pages/404/index.md rename to src/pages/en/404.md diff --git a/src/pages/api/status/index.js b/src/pages/en/api/status.js similarity index 100% rename from src/pages/api/status/index.js rename to src/pages/en/api/status.js diff --git a/src/pages/build-apps/overview/index.md b/src/pages/en/build-apps/overview.md similarity index 100% rename from src/pages/build-apps/overview/index.md rename to src/pages/en/build-apps/overview.md diff --git a/src/pages/build-apps/references/authentication/index.md b/src/pages/en/build-apps/references/authentication.md similarity index 100% rename from src/pages/build-apps/references/authentication/index.md rename to src/pages/en/build-apps/references/authentication.md diff --git a/src/pages/build-apps/references/bns/index.md b/src/pages/en/build-apps/references/bns.md similarity index 100% rename from src/pages/build-apps/references/bns/index.md rename to src/pages/en/build-apps/references/bns.md diff --git a/src/pages/build-apps/references/gaia/index.md b/src/pages/en/build-apps/references/gaia.md similarity index 100% rename from src/pages/build-apps/references/gaia/index.md rename to src/pages/en/build-apps/references/gaia.md diff --git a/src/pages/contributing/index.md b/src/pages/en/contributing.md similarity index 100% rename from src/pages/contributing/index.md rename to src/pages/en/contributing.md diff --git a/src/pages/index.md b/src/pages/en/index.md similarity index 100% rename from src/pages/index.md rename to src/pages/en/index.md diff --git a/src/pages/references/bns-contract/index.md b/src/pages/en/references/bns-contract.md similarity index 100% rename from src/pages/references/bns-contract/index.md rename to src/pages/en/references/bns-contract.md diff --git a/src/pages/references/deploy-tips/index.md b/src/pages/en/references/deploy-tips.md similarity index 100% rename from src/pages/references/deploy-tips/index.md rename to src/pages/en/references/deploy-tips.md diff --git a/src/pages/references/faqs/index.md b/src/pages/en/references/faqs.md similarity index 100% rename from src/pages/references/faqs/index.md rename to src/pages/en/references/faqs.md diff --git a/src/pages/references/glossary/index.md b/src/pages/en/references/glossary.md similarity index 100% rename from src/pages/references/glossary/index.md rename to src/pages/en/references/glossary.md diff --git a/src/pages/references/language-functions/index.md b/src/pages/en/references/language-functions.md similarity index 100% rename from src/pages/references/language-functions/index.md rename to src/pages/en/references/language-functions.md diff --git a/src/pages/references/language-keywords/index.md b/src/pages/en/references/language-keywords.md similarity index 100% rename from src/pages/references/language-keywords/index.md rename to src/pages/en/references/language-keywords.md diff --git a/src/pages/references/language-overview/index.md b/src/pages/en/references/language-overview.md similarity index 100% rename from src/pages/references/language-overview/index.md rename to src/pages/en/references/language-overview.md diff --git a/src/pages/references/language-types/index.md b/src/pages/en/references/language-types.md similarity index 100% rename from src/pages/references/language-types/index.md rename to src/pages/en/references/language-types.md diff --git a/src/pages/references/stacking-contract/index.md b/src/pages/en/references/stacking-contract.md similarity index 100% rename from src/pages/references/stacking-contract/index.md rename to src/pages/en/references/stacking-contract.md diff --git a/src/pages/references/stacks-node-configuration/index.md b/src/pages/en/references/stacks-node-configuration.md similarity index 100% rename from src/pages/references/stacks-node-configuration/index.md rename to src/pages/en/references/stacks-node-configuration.md diff --git a/src/pages/start-mining/mainnet/index.md b/src/pages/en/start-mining/mainnet.md similarity index 100% rename from src/pages/start-mining/mainnet/index.md rename to src/pages/en/start-mining/mainnet.md diff --git a/src/pages/start-mining/testnet/index.md b/src/pages/en/start-mining/testnet.md similarity index 100% rename from src/pages/start-mining/testnet/index.md rename to src/pages/en/start-mining/testnet.md diff --git a/src/pages/understand-stacks/accounts/index.md b/src/pages/en/understand-stacks/accounts.md similarity index 100% rename from src/pages/understand-stacks/accounts/index.md rename to src/pages/en/understand-stacks/accounts.md diff --git a/src/pages/understand-stacks/microblocks/index.md b/src/pages/en/understand-stacks/microblocks.md similarity index 100% rename from src/pages/understand-stacks/microblocks/index.md rename to src/pages/en/understand-stacks/microblocks.md diff --git a/src/pages/understand-stacks/mining/index.md b/src/pages/en/understand-stacks/mining.md similarity index 100% rename from src/pages/understand-stacks/mining/index.md rename to src/pages/en/understand-stacks/mining.md diff --git a/src/pages/understand-stacks/network/index.md b/src/pages/en/understand-stacks/network.md similarity index 100% rename from src/pages/understand-stacks/network/index.md rename to src/pages/en/understand-stacks/network.md diff --git a/src/pages/understand-stacks/overview/index.md b/src/pages/en/understand-stacks/overview.md similarity index 100% rename from src/pages/understand-stacks/overview/index.md rename to src/pages/en/understand-stacks/overview.md diff --git a/src/pages/understand-stacks/proof-of-transfer/index.md b/src/pages/en/understand-stacks/proof-of-transfer.md similarity index 100% rename from src/pages/understand-stacks/proof-of-transfer/index.md rename to src/pages/en/understand-stacks/proof-of-transfer.md diff --git a/src/pages/understand-stacks/running-mainnet-node/index.md b/src/pages/en/understand-stacks/running-mainnet-node.md similarity index 100% rename from src/pages/understand-stacks/running-mainnet-node/index.md rename to src/pages/en/understand-stacks/running-mainnet-node.md diff --git a/src/pages/understand-stacks/running-testnet-node/index.md b/src/pages/en/understand-stacks/running-testnet-node.md similarity index 100% rename from src/pages/understand-stacks/running-testnet-node/index.md rename to src/pages/en/understand-stacks/running-testnet-node.md diff --git a/src/pages/understand-stacks/stacking/index.md b/src/pages/en/understand-stacks/stacking.md similarity index 100% rename from src/pages/understand-stacks/stacking/index.md rename to src/pages/en/understand-stacks/stacking.md diff --git a/src/pages/understand-stacks/stacks-blockchain-api/index.md b/src/pages/en/understand-stacks/stacks-blockchain-api.md similarity index 100% rename from src/pages/understand-stacks/stacks-blockchain-api/index.md rename to src/pages/en/understand-stacks/stacks-blockchain-api.md diff --git a/src/pages/understand-stacks/technical-specs/index.md b/src/pages/en/understand-stacks/technical-specs.md similarity index 100% rename from src/pages/understand-stacks/technical-specs/index.md rename to src/pages/en/understand-stacks/technical-specs.md diff --git a/src/pages/understand-stacks/testnet/index.md b/src/pages/en/understand-stacks/testnet.md similarity index 100% rename from src/pages/understand-stacks/testnet/index.md rename to src/pages/en/understand-stacks/testnet.md diff --git a/src/pages/understand-stacks/transactions/index.md b/src/pages/en/understand-stacks/transactions.md similarity index 100% rename from src/pages/understand-stacks/transactions/index.md rename to src/pages/en/understand-stacks/transactions.md diff --git a/src/pages/write-smart-contracts/overview/index.md b/src/pages/en/write-smart-contracts/overview.md similarity index 100% rename from src/pages/write-smart-contracts/overview/index.md rename to src/pages/en/write-smart-contracts/overview.md diff --git a/src/pages/write-smart-contracts/principals/index.md b/src/pages/en/write-smart-contracts/principals.md similarity index 100% rename from src/pages/write-smart-contracts/principals/index.md rename to src/pages/en/write-smart-contracts/principals.md diff --git a/src/pages/write-smart-contracts/tokens/index.md b/src/pages/en/write-smart-contracts/tokens.md similarity index 100% rename from src/pages/write-smart-contracts/tokens/index.md rename to src/pages/en/write-smart-contracts/tokens.md diff --git a/src/pages/write-smart-contracts/values/index.md b/src/pages/en/write-smart-contracts/values.md similarity index 100% rename from src/pages/write-smart-contracts/values/index.md rename to src/pages/en/write-smart-contracts/values.md diff --git a/src/pages/index/index.md b/src/pages/index/index.md deleted file mode 100644 index 066d3437..00000000 --- a/src/pages/index/index.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: Stacks documentation -description: Learn about Stacks mining, the STX token, and the Clarity smart contract language ---- - --> Content related to developer tools and app development has recently moved to [docs.hiro.so](https://docs.hiro.so/). For more information on the content move, see [this post](https://forum.stacks.org/t/the-evolution-of-the-stacks-documentation-and-a-new-hiro-docs-site/12343) on the Stacks forum. - -## Understand Stacks - -[@page-reference | grid] -| /understand-stacks/overview, /understand-stacks/proof-of-transfer, /understand-stacks/testnet - -## Write smart contracts - -[@page-reference | grid] -| /write-smart-contracts/overview, /write-smart-contracts/tokens - -## Start mining - -[@page-reference | grid] -| /start-mining/mainnet, /start-mining/testnet