Skip to content

Commit 28b6cdb

Browse files
committed
generating docusaurs website structure
1 parent 51619c7 commit 28b6cdb

26 files changed

Lines changed: 7519 additions & 0 deletions

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*/node_modules
2+
*.log

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:lts
2+
3+
WORKDIR /app/website
4+
5+
EXPOSE 3000 35729
6+
COPY ./docs /app/docs
7+
COPY ./website /app/website
8+
RUN yarn install
9+
10+
CMD ["yarn", "start"]

docker-compose.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: "3"
2+
3+
services:
4+
docusaurus:
5+
build: .
6+
ports:
7+
- 3000:3000
8+
- 35729:35729
9+
volumes:
10+
- ./docs:/app/docs
11+
- ./website/blog:/app/website/blog
12+
- ./website/core:/app/website/core
13+
- ./website/i18n:/app/website/i18n
14+
- ./website/pages:/app/website/pages
15+
- ./website/static:/app/website/static
16+
- ./website/sidebars.json:/app/website/sidebars.json
17+
- ./website/siteConfig.js:/app/website/siteConfig.js
18+
working_dir: /app/website

docs/installation.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
id: installation
3+
title: Installation
4+
sidebar_label: Installation
5+
---
6+
7+
Check the [documentation](https://docusaurus.io) for how to use Docusaurus.
8+
9+
## Lorem
10+
11+
First of all, install it using `npm` or `yarn`
12+
13+
```
14+
npm install --save react-native-sensitive-info
15+
```
16+
17+
```
18+
yarn add react-native-sensitive-info
19+
```
20+
21+
22+
## Mauris In Code
23+
24+
```
25+
Mauris vestibulum ullamcorper nibh, ut semper purus pulvinar ut. Donec volutpat orci sit amet mauris malesuada, non pulvinar augue aliquam. Vestibulum ultricies at urna ut suscipit. Morbi iaculis, erat at imperdiet semper, ipsum nulla sodales erat, eget tincidunt justo dui quis justo. Pellentesque dictum bibendum diam at aliquet. Sed pulvinar, dolor quis finibus ornare, eros odio facilisis erat, eu rhoncus nunc dui sed ex. Nunc gravida dui massa, sed ornare arcu tincidunt sit amet. Maecenas efficitur sapien neque, a laoreet libero feugiat ut.
26+
```
27+
28+
## Nulla
29+
30+
Nulla facilisi. Maecenas sodales nec purus eget posuere. Sed sapien quam, pretium a risus in, porttitor dapibus erat. Sed sit amet fringilla ipsum, eget iaculis augue. Integer sollicitudin tortor quis ultricies aliquam. Suspendisse fringilla nunc in tellus cursus, at placerat tellus scelerisque. Sed tempus elit a sollicitudin rhoncus. Nulla facilisi. Morbi nec dolor dolor. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras et aliquet lectus. Pellentesque sit amet eros nisi. Quisque ac sapien in sapien congue accumsan. Nullam in posuere ante. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin lacinia leo a nibh fringilla pharetra.
31+
32+
## Orci
33+
34+
Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin venenatis lectus dui, vel ultrices ante bibendum hendrerit. Aenean egestas feugiat dui id hendrerit. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur in tellus laoreet, eleifend nunc id, viverra leo. Proin vulputate non dolor vel vulputate. Curabitur pretium lobortis felis, sit amet finibus lorem suscipit ut. Sed non mollis risus. Duis sagittis, mi in euismod tincidunt, nunc mauris vestibulum urna, at euismod est elit quis erat. Phasellus accumsan vitae neque eu placerat. In elementum arcu nec tellus imperdiet, eget maximus nulla sodales. Curabitur eu sapien eget nisl sodales fermentum.
35+
36+
## Phasellus
37+
38+
Phasellus pulvinar ex id commodo imperdiet. Praesent odio nibh, sollicitudin sit amet faucibus id, placerat at metus. Donec vitae eros vitae tortor hendrerit finibus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque vitae purus dolor. Duis suscipit ac nulla et finibus. Phasellus ac sem sed dui dictum gravida. Phasellus eleifend vestibulum facilisis. Integer pharetra nec enim vitae mattis. Duis auctor, lectus quis condimentum bibendum, nunc dolor aliquam massa, id bibendum orci velit quis magna. Ut volutpat nulla nunc, sed interdum magna condimentum non. Sed urna metus, scelerisque vitae consectetur a, feugiat quis magna. Donec dignissim ornare nisl, eget tempor risus malesuada quis.

website/README.md

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
This website was created with [Docusaurus](https://docusaurus.io/).
2+
3+
# What's In This Document
4+
5+
- [Get Started in 5 Minutes](#get-started-in-5-minutes)
6+
- [Directory Structure](#directory-structure)
7+
- [Editing Content](#editing-content)
8+
- [Adding Content](#adding-content)
9+
- [Full Documentation](#full-documentation)
10+
11+
# Get Started in 5 Minutes
12+
13+
1. Make sure all the dependencies for the website are installed:
14+
15+
```sh
16+
# Install dependencies
17+
$ yarn
18+
```
19+
20+
2. Run your dev server:
21+
22+
```sh
23+
# Start the site
24+
$ yarn start
25+
```
26+
27+
## Directory Structure
28+
29+
Your project file structure should look something like this
30+
31+
```
32+
my-docusaurus/
33+
docs/
34+
doc-1.md
35+
doc-2.md
36+
doc-3.md
37+
website/
38+
blog/
39+
2016-3-11-oldest-post.md
40+
2017-10-24-newest-post.md
41+
core/
42+
node_modules/
43+
pages/
44+
static/
45+
css/
46+
img/
47+
package.json
48+
sidebars.json
49+
siteConfig.js
50+
```
51+
52+
# Editing Content
53+
54+
## Editing an existing docs page
55+
56+
Edit docs by navigating to `docs/` and editing the corresponding document:
57+
58+
`docs/doc-to-be-edited.md`
59+
60+
```markdown
61+
---
62+
id: page-needs-edit
63+
title: This Doc Needs To Be Edited
64+
---
65+
66+
Edit me...
67+
```
68+
69+
For more information about docs, click [here](https://docusaurus.io/docs/en/navigation)
70+
71+
## Editing an existing blog post
72+
73+
Edit blog posts by navigating to `website/blog` and editing the corresponding post:
74+
75+
`website/blog/post-to-be-edited.md`
76+
77+
```markdown
78+
---
79+
id: post-needs-edit
80+
title: This Blog Post Needs To Be Edited
81+
---
82+
83+
Edit me...
84+
```
85+
86+
For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog)
87+
88+
# Adding Content
89+
90+
## Adding a new docs page to an existing sidebar
91+
92+
1. Create the doc as a new markdown file in `/docs`, example `docs/newly-created-doc.md`:
93+
94+
```md
95+
---
96+
id: newly-created-doc
97+
title: This Doc Needs To Be Edited
98+
---
99+
100+
My new content here..
101+
```
102+
103+
1. Refer to that doc's ID in an existing sidebar in `website/sidebars.json`:
104+
105+
```javascript
106+
// Add newly-created-doc to the Getting Started category of docs
107+
{
108+
"docs": {
109+
"Getting Started": [
110+
"quick-start",
111+
"newly-created-doc" // new doc here
112+
],
113+
...
114+
},
115+
...
116+
}
117+
```
118+
119+
For more information about adding new docs, click [here](https://docusaurus.io/docs/en/navigation)
120+
121+
## Adding a new blog post
122+
123+
1. Make sure there is a header link to your blog in `website/siteConfig.js`:
124+
125+
`website/siteConfig.js`
126+
127+
```javascript
128+
headerLinks: [
129+
...
130+
{ blog: true, label: 'Blog' },
131+
...
132+
]
133+
```
134+
135+
2. Create the blog post with the format `YYYY-MM-DD-My-Blog-Post-Title.md` in `website/blog`:
136+
137+
`website/blog/2018-05-21-New-Blog-Post.md`
138+
139+
```markdown
140+
---
141+
author: Frank Li
142+
authorURL: https://twitter.com/foobarbaz
143+
authorFBID: 503283835
144+
title: New Blog Post
145+
---
146+
147+
Lorem Ipsum...
148+
```
149+
150+
For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog)
151+
152+
## Adding items to your site's top navigation bar
153+
154+
1. Add links to docs, custom pages or external links by editing the headerLinks field of `website/siteConfig.js`:
155+
156+
`website/siteConfig.js`
157+
158+
```javascript
159+
{
160+
headerLinks: [
161+
...
162+
/* you can add docs */
163+
{ doc: 'my-examples', label: 'Examples' },
164+
/* you can add custom pages */
165+
{ page: 'help', label: 'Help' },
166+
/* you can add external links */
167+
{ href: 'https://github.com/facebook/docusaurus', label: 'GitHub' },
168+
...
169+
],
170+
...
171+
}
172+
```
173+
174+
For more information about the navigation bar, click [here](https://docusaurus.io/docs/en/navigation)
175+
176+
## Adding custom pages
177+
178+
1. Docusaurus uses React components to build pages. The components are saved as .js files in `website/pages/en`:
179+
1. If you want your page to show up in your navigation header, you will need to update `website/siteConfig.js` to add to the `headerLinks` element:
180+
181+
`website/siteConfig.js`
182+
183+
```javascript
184+
{
185+
headerLinks: [
186+
...
187+
{ page: 'my-new-custom-page', label: 'My New Custom Page' },
188+
...
189+
],
190+
...
191+
}
192+
```
193+
194+
For more information about custom pages, click [here](https://docusaurus.io/docs/en/custom-pages).
195+
196+
# Full Documentation
197+
198+
Full documentation can be found on the [website](https://docusaurus.io/).

website/core/Footer.js

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
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('doc1.html', this.props.language)}>
41+
Getting Started (or other categories)
42+
</a>
43+
<a href={this.docUrl('doc2.html', this.props.language)}>
44+
Guides (or other categories)
45+
</a>
46+
<a href={this.docUrl('doc3.html', this.props.language)}>
47+
API Reference (or other categories)
48+
</a>
49+
</div>
50+
<div>
51+
<h5>Community</h5>
52+
<a href={this.pageUrl('users.html', this.props.language)}>
53+
User Showcase
54+
</a>
55+
<a
56+
href="https://stackoverflow.com/questions/tagged/"
57+
target="_blank"
58+
rel="noreferrer noopener">
59+
Stack Overflow
60+
</a>
61+
<a href="https://discordapp.com/">Project Chat</a>
62+
<a
63+
href="https://twitter.com/"
64+
target="_blank"
65+
rel="noreferrer noopener">
66+
Twitter
67+
</a>
68+
</div>
69+
<div>
70+
<h5>More</h5>
71+
<a href={`${this.props.config.baseUrl}blog`}>Blog</a>
72+
<a href="https://github.com/">GitHub</a>
73+
<a
74+
className="github-button"
75+
href={this.props.config.repoUrl}
76+
data-icon="octicon-star"
77+
data-count-href="/facebook/docusaurus/stargazers"
78+
data-show-count="true"
79+
data-count-aria-label="# stargazers on GitHub"
80+
aria-label="Star this project on GitHub">
81+
Star
82+
</a>
83+
{this.props.config.twitterUsername && (
84+
<div className="social">
85+
<a
86+
href={`https://twitter.com/${this.props.config.twitterUsername}`}
87+
className="twitter-follow-button">
88+
Follow @{this.props.config.twitterUsername}
89+
</a>
90+
</div>
91+
)}
92+
{this.props.config.facebookAppId && (
93+
<div className="social">
94+
<div
95+
className="fb-like"
96+
data-href={this.props.config.url}
97+
data-colorscheme="dark"
98+
data-layout="standard"
99+
data-share="true"
100+
data-width="225"
101+
data-show-faces="false"
102+
/>
103+
</div>
104+
)}
105+
</div>
106+
</section>
107+
108+
<a
109+
href="https://opensource.facebook.com/"
110+
target="_blank"
111+
rel="noreferrer noopener"
112+
className="fbOpenSource">
113+
<img
114+
src={`${this.props.config.baseUrl}img/oss_logo.png`}
115+
alt="Facebook Open Source"
116+
width="170"
117+
height="45"
118+
/>
119+
</a>
120+
<section className="copyright">{this.props.config.copyright}</section>
121+
</footer>
122+
);
123+
}
124+
}
125+
126+
module.exports = Footer;

0 commit comments

Comments
 (0)