From 4e2d84e0d400ea5d437c3aa03612ffbfd9601ce8 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Tue, 28 Nov 2023 17:35:04 -0800 Subject: [PATCH] [website] docs/introduction => docs/index, add redirects * Rename docs/introduction.md to docs/index.md so that now the main link is just /docs. * Add redirects for some common links from the old sbt microsites website. --- docs/src/{introduction.md => index.md} | 12 ++++++------ website/Makefile | 8 ++++---- website/docusaurus.config.js | 24 +++++++++++++++++++++--- website/src/pages/index.js | 2 +- 4 files changed, 32 insertions(+), 14 deletions(-) rename docs/src/{introduction.md => index.md} (74%) diff --git a/docs/src/introduction.md b/docs/src/index.md similarity index 74% rename from docs/src/introduction.md rename to docs/src/index.md index 21a4936abf6..65d08c8798f 100644 --- a/docs/src/introduction.md +++ b/docs/src/index.md @@ -20,19 +20,19 @@ Scala books to become more expert in Scala programming. For a tutorial covering both Chisel and Scala, see the [**online Chisel Bootcamp**](https://mybinder.org/v2/gh/freechipsproject/chisel-bootcamp/master). -For quick reference "How-To" guides see the [Cookbooks](./cookbooks). +For quick reference "How-To" guides see the [Cookbooks](docs/cookbooks). If you like a textbook to learn Chisel and also a bit of digital design in general, you may be interested in reading [Digital Design with Chisel](http://www.imm.dtu.dk/~masca/chisel-book.html). It is available in English, Chinese, Japanese, and Vietnamese. -For a deeper introduction to key concepts in Chisel see the [Explanations](./explanations). +For a deeper introduction to key concepts in Chisel see the [Explanations](docs/explanations). -The [API Documentation](../api/) gives the detailed reference for the Chisel source code. +The [API Documentation](../api) gives the detailed reference for the Chisel source code. -The [Resources](./resources) provides links to other useful resources for learning and working with Chisel. +The [Resources](docs/resources) provides links to other useful resources for learning and working with Chisel. -The [Appendix](./appendix) covers some more advanced topics. +The [Appendix](docs/appendix) covers some more advanced topics. -The [Developers](./developers) section provides information for those working on the Chisel library itself. +The [Developers](docs/developers) section provides information for those working on the Chisel library itself. >Throughout these pages, we format commentary on our design choices as in this paragraph. You should be able to skip the commentary sections diff --git a/website/Makefile b/website/Makefile index ee299f91862..6fd0b0afd7b 100644 --- a/website/Makefile +++ b/website/Makefile @@ -28,15 +28,15 @@ chisel-website-only = \ default: build -# Using introduction as standin for all md files +# Using index as standin for all md files # Note this doesn't work when a markdown file is deleted -$(mdoc_out)/introduction.md: $(chisel-non-website) +$(mdoc_out)/index.md: $(chisel-non-website) cd $(chisel_dir) && sbt docs/mdoc $(website_docs_dir): mkdir -p $@ -$(website_docs_dir)/introduction.md: $(mdoc_out)/introduction.md | $(website_docs_dir) +$(website_docs_dir)/index.md: $(mdoc_out)/index.md | $(website_docs_dir) cp -R $(mdoc_out)/* $(this_dir)/docs/ contributors_dir = $(this_dir)/src/pages/generated @@ -55,7 +55,7 @@ $(install_timestamp): $(this_dir)/package.json install: $(install_timestamp) -build: $(this_dir)/docs/introduction.md $(contributors) $(install_timestamp) $(chisel-website-only) +build: $(this_dir)/docs/index.md $(contributors) $(install_timestamp) $(chisel-website-only) cd $(this_dir) && npm run build # Must run build first diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 5369a6fa7fb..4e7ea7b2d49 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -86,7 +86,7 @@ const config = { src: 'img/chisel-tool.svg', }, items: [ - {to: '/docs/introduction', label: 'Docs', position: 'left'}, + {to: '/docs', label: 'Docs', position: 'left'}, {to: '/community', label: 'Community', position: 'left'}, {to: '/api', label: 'API', position: 'left'}, { @@ -110,8 +110,8 @@ const config = { title: 'Docs', items: [ { - label: 'Introduction', - to: '/docs/introduction', + label: 'Docs', + to: '/docs', }, { label: 'ScalaDoc', @@ -177,7 +177,25 @@ const config = { '@docusaurus/plugin-client-redirects', { redirects: [ + { // Redirect old latest API docs link + from: '/api/chisel3/latest', + to: '/api', + }, + { // Redirect old chisel3 docs landing page + from: '/chisel3', + to: '/docs', + }, ], + createRedirects(to) { + // Redirect from all /chisel3/docs/X links to /docs/X + // This catches many broken links from old sbt-microsites website + if (to.includes('/docs')) { + return [ + to.replace('/docs', '/chisel3/docs') + ]; + } + return undefined; + }, }, ], ], diff --git a/website/src/pages/index.js b/website/src/pages/index.js index 4043d811cff..4b62a3f2324 100644 --- a/website/src/pages/index.js +++ b/website/src/pages/index.js @@ -17,7 +17,7 @@ function HomepageHeader() {
+ to="/docs"> Chisel Documentation