Skip to content

Commit d84b5c0

Browse files
committed
docs: add doc site
1 parent 44c1255 commit d84b5c0

File tree

13 files changed

+7882
-0
lines changed

13 files changed

+7882
-0
lines changed

documentation/.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

documentation/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Website
2+
3+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4+
5+
### Installation
6+
7+
```
8+
$ yarn
9+
```
10+
11+
### Local Development
12+
13+
```
14+
$ yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
### Build
20+
21+
```
22+
$ yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
### Deployment
28+
29+
Using SSH:
30+
31+
```
32+
$ USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```
38+
$ GIT_USER=<Your GitHub username> yarn deploy
39+
```
40+
41+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

documentation/babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

documentation/docs/intro.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Tutorial Intro
6+
7+
Let's discover **Docusaurus in less than 5 minutes**.
8+
9+
## Getting Started
10+
11+
Get started by **creating a new site**.
12+
13+
Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
14+
15+
## Generate a new site
16+
17+
Generate a new Docusaurus site using the **classic template**:
18+
19+
```shell
20+
npm init docusaurus@latest my-website classic
21+
```
22+
23+
## Start your site
24+
25+
Run the development server:
26+
27+
```shell
28+
cd my-website
29+
30+
npx docusaurus start
31+
```
32+
33+
Your site starts at `http://localhost:3000`.
34+
35+
Open `docs/intro.md` and edit some lines: the site **reloads automatically** and displays your changes.

documentation/docusaurus.config.js

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
// @ts-check
2+
// Note: type annotations allow type checking and IDEs autocompletion
3+
4+
const lightCodeTheme = require('prism-react-renderer/themes/github');
5+
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
6+
7+
/** @type {import('@docusaurus/types').Config} */
8+
const config = {
9+
title: 'React Scroll Parallax',
10+
tagline:
11+
'React components to create parallax scroll effects for banners, images or any other DOM elements.',
12+
url: 'https://todo',
13+
baseUrl: '/',
14+
onBrokenLinks: 'throw',
15+
onBrokenMarkdownLinks: 'warn',
16+
favicon: 'img/favicon.ico',
17+
organizationName: 'jscottsmith', // Usually your GitHub org/user name.
18+
projectName: 'react-scroll-parallax', // Usually your repo name.
19+
20+
presets: [
21+
[
22+
'classic',
23+
/** @type {import('@docusaurus/preset-classic').Options} */
24+
({
25+
docs: {
26+
sidebarPath: require.resolve('./sidebars.js'),
27+
// Please change this to your repo.
28+
editUrl:
29+
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
30+
},
31+
theme: {
32+
customCss: require.resolve('./src/css/custom.css'),
33+
},
34+
}),
35+
],
36+
],
37+
38+
themeConfig:
39+
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
40+
({
41+
navbar: {
42+
title: 'React Scroll Parallax',
43+
logo: {
44+
alt: 'Squares Overlapping',
45+
src: 'img/logo.png',
46+
},
47+
items: [
48+
{
49+
type: 'doc',
50+
docId: 'intro',
51+
position: 'left',
52+
label: 'Usage',
53+
},
54+
],
55+
},
56+
footer: {
57+
style: 'dark',
58+
links: [
59+
{
60+
title: 'Docs',
61+
items: [
62+
{
63+
label: 'Introduction',
64+
to: '/docs/intro',
65+
},
66+
],
67+
},
68+
{
69+
title: 'Elsewhere',
70+
items: [
71+
{
72+
label: 'NPM',
73+
href: 'https://www.npmjs.com/package/react-scroll-parallax',
74+
},
75+
{
76+
label: 'Github',
77+
href: 'https://github.com/jscottsmith/react-scroll-parallax',
78+
},
79+
{
80+
label: 'Support',
81+
href: 'https://github.com/jscottsmith/react-scroll-parallax/issues',
82+
},
83+
],
84+
},
85+
{
86+
title: 'Who',
87+
items: [
88+
{
89+
label: 'J',
90+
href: 'https://github.com/jscottsmith',
91+
},
92+
{
93+
label: 'Damnthat.tv',
94+
href: 'https://damnthat.tv/',
95+
},
96+
{
97+
label: '@damntelevision',
98+
href: 'https://twitter.com/damntelevision',
99+
},
100+
],
101+
},
102+
],
103+
copyright: `It's ok 👌🏻`,
104+
},
105+
prism: {
106+
theme: lightCodeTheme,
107+
darkTheme: darkCodeTheme,
108+
},
109+
}),
110+
};
111+
112+
module.exports = config;

documentation/package.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "documentation",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"docusaurus": "docusaurus",
7+
"start": "docusaurus start",
8+
"build": "docusaurus build",
9+
"swizzle": "docusaurus swizzle",
10+
"deploy": "docusaurus deploy",
11+
"clear": "docusaurus clear",
12+
"serve": "docusaurus serve",
13+
"write-translations": "docusaurus write-translations",
14+
"write-heading-ids": "docusaurus write-heading-ids"
15+
},
16+
"dependencies": {
17+
"@docusaurus/core": "2.0.0-beta.14",
18+
"@docusaurus/preset-classic": "2.0.0-beta.14",
19+
"@mdx-js/react": "^1.6.21",
20+
"clsx": "^1.1.1",
21+
"prism-react-renderer": "^1.2.1",
22+
"react": "^17.0.1",
23+
"react-dom": "^17.0.1"
24+
},
25+
"browserslist": {
26+
"production": [
27+
">0.5%",
28+
"not dead",
29+
"not op_mini all"
30+
],
31+
"development": [
32+
"last 1 chrome version",
33+
"last 1 firefox version",
34+
"last 1 safari version"
35+
]
36+
}
37+
}

documentation/sidebars.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* Creating a sidebar enables you to:
3+
- create an ordered group of docs
4+
- render a sidebar for each doc of that group
5+
- provide next/previous navigation
6+
7+
The sidebars can be generated from the filesystem, or explicitly defined here.
8+
9+
Create as many sidebars as you want.
10+
*/
11+
12+
// @ts-check
13+
14+
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
15+
const sidebars = {
16+
// By default, Docusaurus generates a sidebar from the docs folder structure
17+
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
18+
19+
// But you can create a sidebar manually
20+
/*
21+
tutorialSidebar: [
22+
{
23+
type: 'category',
24+
label: 'Tutorial',
25+
items: ['hello'],
26+
},
27+
],
28+
*/
29+
};
30+
31+
module.exports = sidebars;

documentation/src/css/custom.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* Any CSS included here will be global. The classic template
3+
* bundles Infima by default. Infima is a CSS framework designed to
4+
* work well for content-centric websites.
5+
*/
6+
7+
/* You can override the default Infima variables here. */
8+
:root {
9+
--ifm-color-primary: #25c2a0;
10+
--ifm-color-primary-dark: rgb(33, 175, 144);
11+
--ifm-color-primary-darker: rgb(31, 165, 136);
12+
--ifm-color-primary-darkest: rgb(26, 136, 112);
13+
--ifm-color-primary-light: rgb(70, 203, 174);
14+
--ifm-color-primary-lighter: rgb(102, 212, 189);
15+
--ifm-color-primary-lightest: rgb(146, 224, 208);
16+
--ifm-code-font-size: 95%;
17+
}
18+
19+
.docusaurus-highlight-code-line {
20+
background-color: rgba(0, 0, 0, 0.1);
21+
display: block;
22+
margin: 0 calc(-1 * var(--ifm-pre-padding));
23+
padding: 0 var(--ifm-pre-padding);
24+
}
25+
26+
html[data-theme='dark'] .docusaurus-highlight-code-line {
27+
background-color: rgba(0, 0, 0, 0.3);
28+
}

documentation/src/pages/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react';
2+
import { Redirect } from '@docusaurus/router';
3+
4+
const Home = () => {
5+
return <Redirect to="/docs/intro" />;
6+
};
7+
8+
export default Home;

documentation/static/.nojekyll

Whitespace-only changes.

documentation/static/img/favicon.ico

3.54 KB
Binary file not shown.

documentation/static/img/logo.png

655 Bytes
Loading

0 commit comments

Comments
 (0)