Skip to content

Commit 377987b

Browse files
authored
Add basic doc structure using docusaurus (#125)
1 parent 36748ef commit 377987b

18 files changed

+12521
-0
lines changed

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,15 @@ jspm_packages
3838

3939
# ide
4040
.idea
41+
42+
# docusaurus
43+
.DS_Store
44+
45+
lib/core/metadata.js
46+
lib/core/MetadataBlog.js
47+
48+
website/translated_docs
49+
website/build/
50+
website/yarn.lock
51+
website/node_modules
52+
website/i18n/*

docs/cli.md

+884
Large diffs are not rendered by default.

website/README.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
You will need to to have `Node >= 8.x` and `Yarn >= 1.5`.
2+
3+
# Run the local server
4+
5+
1. Make sure all the dependencies for the website are installed:
6+
7+
```sh
8+
$ yarn
9+
```
10+
or
11+
```sh
12+
$ npm install
13+
```
14+
15+
2. Go to the `website` directory and run your dev server:
16+
17+
```sh
18+
$ yarn start
19+
```
20+
or
21+
```sh
22+
$ npm run start
23+
```
24+
25+
## Directory Structure
26+
27+
Your project file structure should look something like this
28+
29+
```
30+
my-docusaurus/
31+
docs/
32+
cli.md
33+
website/
34+
blog/
35+
core/
36+
node_modules/
37+
pages/
38+
static/
39+
css/
40+
img/
41+
versioned_docs/
42+
versioned_sidebars/
43+
README.md
44+
package.json
45+
sidebar.json
46+
siteConfig.js
47+
versions.json
48+
```
49+
50+
# Publish the website
51+
The Claycli website will live on GitHub page. You just need to run the following commands:
52+
```
53+
$ yarn build
54+
```
55+
or
56+
```
57+
$ npm run build
58+
```
59+
60+
Then you just need to deploy the static files generated. These files will be pushed to the `gh-page` branch.
61+
```
62+
$ yarn deploy
63+
```
64+
or
65+
```
66+
$ npm run deploy
67+
```

website/core/Footer.js

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/**
2+
* Copyright (c) 2017-present, Facebook, Inc.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
const React = require('react');
9+
10+
class Footer extends React.Component {
11+
docUrl(doc, language) {
12+
const baseUrl = this.props.config.baseUrl;
13+
const docsUrl = this.props.config.docsUrl;
14+
const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`;
15+
const langPart = `${language ? `${language}/` : ''}`;
16+
return `${baseUrl}${docsPart}${langPart}${doc}`;
17+
}
18+
19+
pageUrl(doc, language) {
20+
const baseUrl = this.props.config.baseUrl;
21+
return baseUrl + (language ? `${language}/` : '') + doc;
22+
}
23+
24+
render() {
25+
return (
26+
<footer className="nav-footer" id="footer">
27+
<section className="sitemap">
28+
<a href={this.props.config.baseUrl} className="nav-home">
29+
{this.props.config.footerIcon && (
30+
<img
31+
src={this.props.config.baseUrl + this.props.config.footerIcon}
32+
alt={this.props.config.title}
33+
width="66"
34+
height="58"
35+
/>
36+
)}
37+
</a>
38+
<div>
39+
<h5>Docs</h5>
40+
<a href={this.docUrl('cli.html', this.props.language)}>
41+
Claycli
42+
</a>
43+
</div>
44+
<div>
45+
<h5>Community</h5>
46+
</div>
47+
<div>
48+
<h5>More</h5>
49+
<a href="https://github.com/clay/claycli">GitHub</a>
50+
<a
51+
className="github-button"
52+
href={this.props.config.repoUrl}
53+
data-icon="octicon-star"
54+
data-count-href="/clay/claycli/stargazers"
55+
data-show-count="true"
56+
data-count-aria-label="# stargazers on GitHub"
57+
aria-label="Star Claycli on GitHub">
58+
Star
59+
</a>
60+
</div>
61+
</section>
62+
63+
<section className="copyright">{this.props.config.copyright}</section>
64+
</footer>
65+
);
66+
}
67+
}
68+
69+
module.exports = Footer;

0 commit comments

Comments
 (0)