Skip to content

Commit ec4bc5c

Browse files
authored
docs(docusaurus): initial documentation on docusaurus (#5)
1 parent 8c18f6f commit ec4bc5c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+7750
-0
lines changed

.dockerignore

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

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
GIT_USER=rogeralbinoi

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:8.11.4
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: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
id: installation
3+
title: Installation
4+
sidebar_label: Installation
5+
---
6+
7+
8+
## YARN
9+
10+
```sh
11+
yarn add lazyload-vue
12+
```
13+
14+
## NPM
15+
16+
```sh
17+
npm install lazyload-vue --save
18+
```
19+
20+
When used with a module system, you must explicitly install LazyloadVue via Vue.use():
21+
22+
```js
23+
import Vue from 'vue'
24+
import LazyloadVue from 'lazyload-vue'
25+
26+
Vue.use(LazyloadVue)
27+
```

docs/instances.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
id: instances
3+
title: Instances
4+
---
5+
6+
## Options documentation
7+
8+
Check options section on documentation: [vanilla-lazyload](https://github.com/verlok/lazyload)
9+
10+
## Example
11+
12+
### App.vue
13+
14+
```js
15+
import LazyloadVue from 'lazyload-vue'
16+
17+
Vue.use(LazyloadVue, {
18+
instances: {
19+
// configure root instance
20+
root: {
21+
elements_selector: '.lazy-custom-root'
22+
},
23+
// optional foobar instance
24+
foobar: {
25+
elements_selector: '.lazy-webp'
26+
to_webp: true // enable switch to webp
27+
}
28+
}
29+
})
30+
```
31+
32+
### MyComponent.vue
33+
34+
```html
35+
<template>
36+
<div>
37+
<img v-lazy-src="http://lorempixel.com/300/300">
38+
<img v-lazy-src:foobar="http://lorempixel.com/300/300">
39+
</div>
40+
</template>
41+
```

docs/lazy-container.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
id: lazy-container
3+
title: lazy-container
4+
---
5+
6+
## Example
7+
8+
```html
9+
<template>
10+
<div v-lazy-container class="scrollingPanel">
11+
<img v-lazy-src="http://lorempixel.com/300/300" />
12+
... other images
13+
</div>
14+
</template>
15+
<style>
16+
.scrollingPanel {
17+
overflow-y: scroll;
18+
-webkit-overflow-scrolling: touch;
19+
}
20+
</style>
21+
```

docs/lazy-src.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
id: lazy-src
3+
title: lazy-src
4+
---
5+
6+
## Example
7+
8+
```html
9+
<template>
10+
<img v-lazy-src="http://lorempixel.com/300/300" />
11+
</template>
12+
```

docs/what-is.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
id: what-is
3+
title: What is LazyloadVue?
4+
---
5+
6+
Vue Plugin for [vanilla-lazyload](https://github.com/verlok/lazyload)

website/README.md

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

0 commit comments

Comments
 (0)