Skip to content

Commit dbc9ae2

Browse files
committed
added
1 parent 926b2ab commit dbc9ae2

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

src/App.js

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import React, { Fragment, Component } from "react";
22
import { Button } from 'reactstrap';
33

44
import Navigation from './Components/Navigation';
@@ -7,6 +7,13 @@ import Herocontent from './Components/Herocontent';
77
import ReactMarkdown from 'react-markdown';
88
import AppMarkdown from '../README.md';
99

10+
const importAll = (r) => r.keys().map(r);
11+
const markdownFiles = importAll(require.context('../docs', false, /\.md$/))
12+
.sort()
13+
.reverse();
14+
15+
console.log("markdownFiles====>"+markdownFiles);
16+
1017
class App extends React.Component {
1118
constructor(props){
1219
super(props);
@@ -19,7 +26,7 @@ class App extends React.Component {
1926
}
2027

2128
componentDidMount() {
22-
fetch('../README.md')
29+
fetch('../docs/SUMMARY.md')
2330
.then((resp) => resp.text())
2431
.then(data => {
2532
this.setState(
@@ -46,11 +53,25 @@ class App extends React.Component {
4653
<div>
4754
<Navigation />
4855
<Herocontent />
49-
<ReactMarkdown source={markdown} />
5056
<Main />
57+
<Fragment>
58+
<section className="section">
59+
<div className="container">
60+
<div className="card">
61+
<div className="card-content">
62+
<div className="content">
63+
<ReactMarkdown source={markdown} />
64+
</div>
65+
</div>
66+
</div>
67+
</div>
68+
</section>
69+
</Fragment>
5170
</div>
5271
);
5372
}
5473
}
5574

5675
export default App;
76+
77+
//https://medium.com/@shawnstern/importing-multiple-markdown-files-into-a-react-component-with-webpack-7548559fce6f

0 commit comments

Comments
 (0)