Skip to content

Commit dedef11

Browse files
authored
docs: add banner from old site to new site, link from new to old (#5414)
1 parent 668cb66 commit dedef11

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed

docs-next/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This is the new site, hosted at https://mochajs.org/next and built with [Astro Starlight](https://starlight.astro.build). For details on how to build alongside the old site, see the `docs` directory.
44

5+
## Preview the new site on its own
6+
57
To run this site alone:
68

79
```shell
@@ -11,4 +13,23 @@ npm run generate
1113
npm run dev
1214
```
1315

16+
## Build the new site into a folder with the old site
17+
18+
```shell
19+
cd docs-next
20+
npm i
21+
npm run build-with-old
22+
```
23+
24+
## Preview the old and new site together
25+
26+
First, build the new site into a folder with the old site above.
27+
28+
```shell
29+
cd .. # back to root dir
30+
npm run docs:preview
31+
```
32+
33+
The new site will be at `http://localhost:8080/next`
34+
1435
However, note that relative links may resolve with `dev` but fail with `build` and `preview` (see https://github.com/mochajs/mocha/issues/5415).

docs-next/src/content/docs/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Supporters from "../../components/Supporters.astro";
1616

1717
:::note[New Site Preview]
1818
Hello!
19-
Welcome to this preview of a revamped **mochajs.org** docs site!
19+
Welcome to this preview of a revamped [**mochajs.org**](https://mochajs.org) docs site!
2020

2121
This is an early stage preview.
2222
If you see any **bugs** or **typos**, please [file a docs issue on mochajs/mocha](https://github.com/mochajs/mocha/issues/new?template=02-documentation.yml).

docs/css/style.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,15 @@ footer {
296296
bottom: 0;
297297
}
298298

299+
.admonition {
300+
background: #f5f2f0; /* background of code blocks */
301+
border: #8d6748 1px solid; /* color of link text */
302+
border-radius: 4px;
303+
margin-top: 8px;
304+
padding: 8px;
305+
text-align: center;
306+
}
307+
299308
.sponsorship {
300309
display: flex;
301310
align-items: center;

docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: 'Mocha - the fun, simple, flexible JavaScript test framework'
44
description: 'Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun.'
55
---
66

7+
<div class="admonition">This site has a new look, try it out at <a href="mochajs.org/next">mochajs.org/next</a>!</div>
8+
79
Mocha is a feature-rich JavaScript test framework running on [Node.js][] and in the browser, making asynchronous testing _simple_ and _fun_. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases. Hosted on [GitHub][github-mocha].
810

911
<nav class="badges">

0 commit comments

Comments
 (0)