Skip to content

Commit 8655150

Browse files
committed
chore: moving from docz to docusaurus
1 parent ac237ce commit 8655150

29 files changed

Lines changed: 19319 additions & 16153 deletions

docs/.eslintrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/.gitignore

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
1-
.docz
2-
node_modules
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+
```bash
8+
yarn
9+
```
10+
11+
## Local Development
12+
13+
```bash
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+
```bash
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+
```bash
32+
USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```bash
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/gallery.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
sidebar_position: 2
3+
title: Gallery
4+
---
5+
6+
import { Gallery } from '@site/src/components/Gallery';
7+
8+
# Gallery
9+
10+
Browse all available country flags:
11+
12+
<Gallery />

docs/docs/getting-started.mdx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
slug: /
3+
sidebar_position: 1
4+
title: Getting Started
5+
---
6+
7+
import { CircleFlag } from 'react-circle-flags';
8+
9+
# react-circle-flags
10+
11+
A React component with a collection of 300+ minimal circular SVG country flags.
12+
13+
## Install
14+
15+
```bash
16+
npm install --save react-circle-flags
17+
```
18+
19+
## Basic usage
20+
21+
```jsx live
22+
function FlagExample() {
23+
return <CircleFlag countryCode="ar" height="100" />;
24+
}
25+
```
26+
27+
You can pass all the React `React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>` props to CircleFlag.
28+
29+
## With custom CDN
30+
31+
```jsx
32+
import { CircleFlag } from 'react-circle-flags'
33+
34+
export const ArgentinianFlag = () => (
35+
<CircleFlag countryCode="ar" height="35" cdnUrl="https://magic-cdn.com/flags/" />
36+
)
37+
```
38+
39+
## Language flags
40+
41+
```jsx live
42+
function LanguageFlagExample() {
43+
return <CircleFlagLanguage languageCode="en-us" height="100" />;
44+
}
45+
```

docs/docusaurus.config.js

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
// @ts-check
2+
// `@type` JSDoc annotations allow editor autocompletion and type checking
3+
// (when paired with `@ts-check`).
4+
// There are various equivalent ways to declare your Docusaurus config.
5+
// See: https://docusaurus.io/docs/api/docusaurus-config
6+
7+
import {themes as prismThemes} from 'prism-react-renderer';
8+
9+
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
10+
11+
/** @type {import('@docusaurus/types').Config} */
12+
const config = {
13+
title: 'My Site',
14+
tagline: 'Dinosaurs are cool',
15+
favicon: 'img/favicon.ico',
16+
17+
// Future flags, see https://docusaurus.io/docs/api/docusaurus-config#future
18+
future: {
19+
v4: true, // Improve compatibility with the upcoming Docusaurus v4
20+
},
21+
22+
// Set the production url of your site here
23+
url: 'https://on-the-edge-cloud.github.io/',
24+
// Set the /<baseUrl>/ pathname under which your site is served
25+
// For GitHub pages deployment, it is often '/<projectName>/'
26+
baseUrl: '/react-circle-flags/',
27+
28+
// GitHub pages deployment config.
29+
// If you aren't using GitHub pages, you don't need these.
30+
organizationName: 'on-the-edge-cloud', // Usually your GitHub org/user name.
31+
projectName: 'react-circle-flags', // Usually your repo name.
32+
33+
onBrokenLinks: 'throw',
34+
35+
// Even if you don't use internationalization, you can use this field to set
36+
// useful metadata like html lang. For example, if your site is Chinese, you
37+
// may want to replace "en" with "zh-Hans".
38+
i18n: {
39+
defaultLocale: 'en',
40+
locales: ['en'],
41+
},
42+
43+
presets: [
44+
[
45+
'classic',
46+
/** @type {import('@docusaurus/preset-classic').Options} */
47+
({
48+
docs: {
49+
sidebarPath: './sidebars.js',
50+
// Please change this to your repo.
51+
// Remove this to remove the "edit this page" links.
52+
editUrl:
53+
'https://github.com/on-the-edge-cloud/react-circle-flags/tree/master/documentation/',
54+
},
55+
blog: false,
56+
theme: {
57+
customCss: './src/css/custom.css',
58+
},
59+
}),
60+
],
61+
],
62+
63+
themeConfig:
64+
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
65+
({
66+
// Replace with your project's social card
67+
image: 'img/docusaurus-social-card.jpg',
68+
colorMode: {
69+
respectPrefersColorScheme: true,
70+
},
71+
navbar: {
72+
title: 'react-circle-flags',
73+
logo: {
74+
alt: 'react-circle-flags Logo',
75+
src: 'img/logo.svg',
76+
},
77+
items: [
78+
{
79+
href: 'https://github.com/on-the-edge-cloud/react-circle-flags',
80+
label: 'GitHub',
81+
position: 'right',
82+
},
83+
],
84+
},
85+
footer: {
86+
style: 'dark',
87+
links: [
88+
{
89+
title: 'More',
90+
items: [
91+
{
92+
label: 'GitHub',
93+
href: 'https://github.com/on-the-edge-cloud/react-circle-flags',
94+
},
95+
],
96+
},
97+
],
98+
copyright: `Copyright © ${new Date().getFullYear()} react-circle-flags. Built with Docusaurus.`,
99+
},
100+
prism: {
101+
theme: prismThemes.github,
102+
darkTheme: prismThemes.dracula,
103+
},
104+
}),
105+
};
106+
107+
export default config;

docs/doczrc.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)