Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[website] docs/introduction => docs/index, add redirects #3656

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/src/introduction.md → docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions website/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
24 changes: 21 additions & 3 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
{
Expand All @@ -110,8 +110,8 @@ const config = {
title: 'Docs',
items: [
{
label: 'Introduction',
to: '/docs/introduction',
label: 'Docs',
to: '/docs',
},
{
label: 'ScalaDoc',
Expand Down Expand Up @@ -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;
},
},
],
],
Expand Down
2 changes: 1 addition & 1 deletion website/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function HomepageHeader() {
<div className={styles.buttons}>
<Link
className="button button--secondary button--lg"
to="/docs/introduction">
to="/docs">
Chisel Documentation
</Link>
</div>
Expand Down
Loading