Skip to content

Commit 194e266

Browse files
committed
rename index.md
1 parent 20799a8 commit 194e266

File tree

8 files changed

+82
-85
lines changed

8 files changed

+82
-85
lines changed

src/components/Site/Site.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function Site(props) {
7777
*/
7878
const _strip = (array) => {
7979
let anchorTitleIndex = array.findIndex(
80-
(item) => item.name.toLowerCase() === 'index.md'
80+
(item) => item.name.toLowerCase() === 'index.mdx'
8181
);
8282

8383
if (anchorTitleIndex !== -1) {

src/components/Splash/Splash.jsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { PlaceholderComponent } from '../Placeholder/Placeholder';
1111
import isClient from '../../utilities/is-client';
1212

1313
// Import Demo Content
14-
import SplashContent from '../../content/index.md';
14+
import SplashContent from '../../content/index.mdx';
1515

1616
// Load Styling
1717
import './Splash.scss';
@@ -55,11 +55,7 @@ const Splash = () => {
5555
<div className="splash__section splash__section--dark page__content">
5656
<Container>
5757
<Markdown>
58-
<div
59-
dangerouslySetInnerHTML={{
60-
__html: SplashContent,
61-
}}
62-
/>
58+
<SplashContent />
6359
</Markdown>
6460
</Container>
6561
</div>

src/components/Splash/first/left.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**src/index.js**
2+
3+
```js
4+
import bar from './bar.js';
5+
6+
bar();
7+
```

src/components/Splash/first/right.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**src/bar.js**
2+
3+
```js
4+
export default function bar() {
5+
//
6+
}
7+
```

src/components/Splash/second/left.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
**[Without config](https://youtu.be/3Nv9muOkb6k?t=21293)** or provide custom **webpack.config.js**
2+
3+
```js
4+
const path = require('path');
5+
6+
module.exports = {
7+
entry: './src/index.js',
8+
output: {
9+
path: path.resolve(__dirname, 'dist'),
10+
filename: 'bundle.js',
11+
},
12+
};
13+
```
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
**page.html**
2+
3+
```html
4+
<!DOCTYPE html>
5+
<html>
6+
<head>
7+
<meta charset="utf-8" />
8+
...
9+
</head>
10+
<body>
11+
...
12+
<script src="dist/bundle.js"></script>
13+
</body>
14+
</html>
15+
```

src/content/index.md

Lines changed: 0 additions & 78 deletions
This file was deleted.

src/content/index.mdx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: webpack
3+
sort: -1
4+
---
5+
6+
import FirstLeft from '../components/Splash/first/left.mdx';
7+
import FirstRigth from '../components/Splash/first/right.mdx';
8+
import SecondLeft from '../components/Splash/second/left.mdx';
9+
import SecondRight from '../components/Splash/second/right.mdx';
10+
11+
## Write Your Code
12+
13+
<div className="splash__wrap">
14+
<div className="splash__left">
15+
<FirstLeft />
16+
</div>
17+
<div className="splash__right">
18+
<FirstRigth />
19+
</div>
20+
</div>
21+
22+
## Bundle It
23+
24+
<div className="splash__wrap">
25+
<div className="splash__left">
26+
<SecondLeft />
27+
</div>
28+
<div className="splash__right">
29+
<SecondRight />
30+
</div>
31+
</div>
32+
33+
Then run `webpack` on the command-line to create `bundle.js`.
34+
35+
## Awesome isn't it? Let's dive in!
36+
37+
**[Get Started](/guides/getting-started)** quickly in our **Guides** section, or dig into the **[Concepts](/concepts)** section for more high-level information on the core notions behind webpack.

0 commit comments

Comments
 (0)