Skip to content

Commit 567f027

Browse files
docs: add website
1 parent 1855378 commit 567f027

20 files changed

+9689
-0
lines changed

docs/.eslintrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
rules: {
3+
'react/react-in-jsx-scope': 'off',
4+
},
5+
};

docs/.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*

docs/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](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.

docs/docs/intro.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Docs here!

docs/docusaurus.config.ts

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
import { themes as prismThemes } from 'prism-react-renderer';
2+
import type { Config } from '@docusaurus/types';
3+
import type * as Preset from '@docusaurus/preset-classic';
4+
5+
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
6+
7+
const config: Config = {
8+
title: 'Safe Area Context',
9+
tagline: 'A flexible way to handle safe area insets',
10+
favicon: 'img/favicon.ico',
11+
12+
// Set the production url of your site here
13+
url: 'https://docs.appandflow.com',
14+
// Set the /<baseUrl>/ pathname under which your site is served
15+
// For GitHub pages deployment, it is often '/<projectName>/'
16+
baseUrl: '/react-native-safe-area-context/',
17+
18+
// GitHub pages deployment config.
19+
// If you aren't using GitHub pages, you don't need these.
20+
organizationName: 'AppAndFlow', // Usually your GitHub org/user name.
21+
projectName: 'react-native-safe-area-context', // Usually your repo name.
22+
23+
onBrokenLinks: 'throw',
24+
onBrokenMarkdownLinks: 'warn',
25+
26+
// Even if you don't use internationalization, you can use this field to set
27+
// useful metadata like html lang. For example, if your site is Chinese, you
28+
// may want to replace "en" with "zh-Hans".
29+
i18n: {
30+
defaultLocale: 'en',
31+
locales: ['en'],
32+
},
33+
34+
presets: [
35+
[
36+
'classic',
37+
{
38+
docs: {
39+
sidebarPath: './sidebars.ts',
40+
// Please change this to your repo.
41+
// Remove this to remove the "edit this page" links.
42+
editUrl:
43+
'https://github.com/AppAndFlow/react-native-safe-area-context/tree/main/docs/',
44+
},
45+
theme: {
46+
customCss: './src/css/custom.css',
47+
},
48+
} satisfies Preset.Options,
49+
],
50+
],
51+
52+
themeConfig: {
53+
// Replace with your project's social card
54+
image: 'img/docusaurus-social-card.jpg',
55+
navbar: {
56+
title: 'My Site',
57+
logo: {
58+
alt: 'My Site Logo',
59+
src: 'img/logo.svg',
60+
},
61+
items: [
62+
{
63+
type: 'docSidebar',
64+
sidebarId: 'docsSidebar',
65+
position: 'left',
66+
label: 'Docs',
67+
},
68+
{
69+
href: 'https://github.com/AppAndFlow/react-native-safe-area-context',
70+
label: 'GitHub',
71+
position: 'right',
72+
},
73+
],
74+
},
75+
footer: {
76+
style: 'light',
77+
links: [],
78+
// copyright: `Copyright © ${new Date().getFullYear()} App & Flow. Built with Docusaurus.`, // Do we want this?
79+
},
80+
prism: {
81+
theme: prismThemes.github,
82+
darkTheme: prismThemes.dracula,
83+
},
84+
} satisfies Preset.ThemeConfig,
85+
};
86+
87+
export default config;

docs/package.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "docs",
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+
"typecheck": "tsc"
16+
},
17+
"dependencies": {
18+
"@docusaurus/core": "3.7.0",
19+
"@docusaurus/preset-classic": "3.7.0",
20+
"@mdx-js/react": "^3.0.0",
21+
"clsx": "^2.0.0",
22+
"prism-react-renderer": "^2.3.0",
23+
"react": "^19.0.0",
24+
"react-dom": "^19.0.0"
25+
},
26+
"devDependencies": {
27+
"@docusaurus/module-type-aliases": "3.7.0",
28+
"@docusaurus/tsconfig": "3.7.0",
29+
"@docusaurus/types": "3.7.0",
30+
"typescript": "~5.6.2"
31+
},
32+
"browserslist": {
33+
"production": [
34+
">0.5%",
35+
"not dead",
36+
"not op_mini all"
37+
],
38+
"development": [
39+
"last 3 chrome version",
40+
"last 3 firefox version",
41+
"last 5 safari version"
42+
]
43+
},
44+
"engines": {
45+
"node": ">=18.0"
46+
}
47+
}

docs/sidebars.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';
2+
3+
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
4+
5+
/**
6+
* Creating a sidebar enables you to:
7+
- create an ordered group of docs
8+
- render a sidebar for each doc of that group
9+
- provide next/previous navigation
10+
11+
The sidebars can be generated from the filesystem, or explicitly defined here.
12+
13+
Create as many sidebars as you want.
14+
*/
15+
const sidebars: SidebarsConfig = {
16+
docsSidebar: [{ type: 'autogenerated', dirName: '.' }],
17+
};
18+
19+
export default sidebars;

docs/src/css/custom.css

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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: #2e8555;
10+
--ifm-color-primary-dark: #29784c;
11+
--ifm-color-primary-darker: #277148;
12+
--ifm-color-primary-darkest: #205d3b;
13+
--ifm-color-primary-light: #33925d;
14+
--ifm-color-primary-lighter: #359962;
15+
--ifm-color-primary-lightest: #3cad6e;
16+
--ifm-code-font-size: 95%;
17+
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
18+
}
19+
20+
/* For readability concerns, you should choose a lighter palette in dark mode. */
21+
[data-theme='dark'] {
22+
--ifm-color-primary: #25c2a0;
23+
--ifm-color-primary-dark: #21af90;
24+
--ifm-color-primary-darker: #1fa588;
25+
--ifm-color-primary-darkest: #1a8870;
26+
--ifm-color-primary-light: #29d5b0;
27+
--ifm-color-primary-lighter: #32d8b4;
28+
--ifm-color-primary-lightest: #4fddbf;
29+
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
30+
}

docs/src/pages/index.module.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* CSS files with the .module.css suffix will be treated as CSS modules
3+
* and scoped locally.
4+
*/
5+
6+
.heroBanner {
7+
padding: 4rem 0;
8+
text-align: center;
9+
position: relative;
10+
overflow: hidden;
11+
}
12+
13+
@media screen and (max-width: 996px) {
14+
.heroBanner {
15+
padding: 2rem;
16+
}
17+
}
18+
19+
.buttons {
20+
display: flex;
21+
align-items: center;
22+
justify-content: center;
23+
}

docs/src/pages/index.tsx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import type { ReactNode } from 'react';
2+
import clsx from 'clsx';
3+
import Link from '@docusaurus/Link';
4+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
5+
import Layout from '@theme/Layout';
6+
import Heading from '@theme/Heading';
7+
8+
import styles from './index.module.css';
9+
10+
function HomepageHeader() {
11+
const { siteConfig } = useDocusaurusContext();
12+
return (
13+
<header className={clsx('hero hero--primary', styles.heroBanner)}>
14+
<div className="container">
15+
<Heading as="h1" className="hero__title">
16+
{siteConfig.title}
17+
</Heading>
18+
<p className="hero__subtitle">{siteConfig.tagline}</p>
19+
<div className={styles.buttons}>
20+
<Link
21+
className="button button--secondary button--lg"
22+
to="/docs/intro"
23+
>
24+
Docusaurus Tutorial - 5min ⏱️
25+
</Link>
26+
</div>
27+
</div>
28+
</header>
29+
);
30+
}
31+
32+
export default function Home(): ReactNode {
33+
const { siteConfig } = useDocusaurusContext();
34+
return (
35+
<Layout
36+
title={`Hello from ${siteConfig.title}`}
37+
description="Description will go into a meta tag in <head />"
38+
>
39+
<HomepageHeader />
40+
</Layout>
41+
);
42+
}

0 commit comments

Comments
 (0)