Skip to content

Commit

Permalink
feat(docs): add docusaurus workspace, initial setup of docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AmruthPillai committed Mar 8, 2022
1 parent a131bb3 commit dc4aa0b
Show file tree
Hide file tree
Showing 16 changed files with 6,387 additions and 380 deletions.
20 changes: 16 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
dist
.next
__ENV.js
node_modules
# Global
node_modules

# Schema
schema/dist

# Server
server/dist

# Client
client/.next
client/public/__ENV.js

# Docs
docs/build
docs/.docusaurus
4 changes: 4 additions & 0 deletions docs/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../.eslintrc.json",
"ignorePatterns": ["build", ".docusaurus"]
}
20 changes: 20 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
3 changes: 3 additions & 0 deletions docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
47 changes: 47 additions & 0 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
sidebar_position: 1
---

# Tutorial Intro

Let's discover **Docusaurus in less than 5 minutes**.

## Getting Started

Get started by **creating a new site**.

Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.

### What you'll need

- [Node.js](https://nodejs.org/en/download/) version 14 or above:
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.

## Generate a new site

Generate a new Docusaurus site using the **classic template**.

The classic template will automatically be added to your project after you run the command:

```bash
npm init docusaurus@latest my-website classic
```

You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.

The command also installs all necessary dependencies you need to run Docusaurus.

## Start your site

Run the development server:

```bash
cd my-website
npm run start
```

The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.

The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.

Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.
120 changes: 120 additions & 0 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Reactive Resume',
tagline: 'A free and open source resume builder.',
url: 'https://docs.rxresu.me',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'AmruthPillai',
projectName: 'Reactive-Resume',

presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
blog: false,
docs: {
routeBasePath: '/',
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/AmruthPillai/Reactive-Resume/tree/main/docs',
},
sitemap: {
changefreq: 'weekly',
priority: 0.5,
},
theme: {
customCss: require.resolve('./styles/custom.css'),
},
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: 'Reactive Resume',
logo: {
alt: 'Reactive Resume',
src: 'img/logo.svg',
},
items: [
{
href: 'https://github.com/AmruthPillai/Reactive-Resume',
position: 'right',
label: 'GitHub',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Sections',
items: [
{
label: 'Documentation',
to: '/docs/intro',
},
],
},
{
title: 'Community',
items: [
{
label: 'GitHub',
href: 'https://github.com/AmruthPillai/Reactive-Resume',
},
{
label: 'Twitter',
href: 'https://twitter.com/AmruthPillai',
},
],
},
{
title: 'Support',
items: [
{
label: 'Translate',
href: 'https://translate.rxresu.me',
},
{
label: 'Donate',
href: 'https://buymeacoffee.com/AmruthPillai',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Amruth Pillai. Licensed under MIT. Built with Docusaurus.`,
},
metadata: [
{
name: 'keywords',
content: [
'reactive resume',
'resume builder',
'free resumes',
'resume templates',
'free resume templates',
'open source resume builder',
'resume builder source code',
].join(', '),
},
],
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
};

module.exports = config;
43 changes: 43 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "@reactive-resume/docs",
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
},
"dependencies": {
"@algolia/client-search": "^4.9.1",
"@docusaurus/core": "2.0.0-beta.17",
"@docusaurus/preset-classic": "2.0.0-beta.17",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.1.1",
"prism-react-renderer": "^1.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.17",
"@tsconfig/docusaurus": "^1.0.4",
"@types/react": ">=16.8.0 <18.0.0",
"typescript": "^4.6.2"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
31 changes: 31 additions & 0 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/

// @ts-check

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }],

// But you can create a sidebar manually
/*
tutorialSidebar: [
{
type: 'category',
label: 'Tutorial',
items: ['hello'],
},
],
*/
};

module.exports = sidebars;
Empty file added docs/static/.nojekyll
Empty file.
Binary file added docs/static/img/favicon.ico
Binary file not shown.
17 changes: 17 additions & 0 deletions docs/static/img/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions docs/styles/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* Any CSS included here will be global. The classic template
* bundles Infima by default. Infima is a CSS framework designed to
* work well for content-centric websites.
*/

/* You can override the default Infima variables here. */
:root {
--ifm-color-primary: #2e8555;
--ifm-color-primary-dark: #29784c;
--ifm-color-primary-darker: #277148;
--ifm-color-primary-darkest: #205d3b;
--ifm-color-primary-light: #33925d;
--ifm-color-primary-lighter: #359962;
--ifm-color-primary-lightest: #3cad6e;
--ifm-code-font-size: 95%;
}

/* For readability concerns, you should choose a lighter palette in dark mode. */
[data-theme='dark'] {
--ifm-color-primary: #25c2a0;
--ifm-color-primary-dark: #21af90;
--ifm-color-primary-darker: #1fa588;
--ifm-color-primary-darkest: #1a8870;
--ifm-color-primary-light: #29d5b0;
--ifm-color-primary-lighter: #32d8b4;
--ifm-color-primary-lightest: #4fddbf;
}

.docusaurus-highlight-code-line {
background-color: rgba(0, 0, 0, 0.1);
display: block;
margin: 0 calc(-1 * var(--ifm-pre-padding));
padding: 0 var(--ifm-pre-padding);
}

[data-theme='dark'] .docusaurus-highlight-code-line {
background-color: rgba(0, 0, 0, 0.3);
}
6 changes: 6 additions & 0 deletions docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "@tsconfig/docusaurus/tsconfig.json",
"compilerOptions": {
"baseUrl": "."
}
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"workspaces": [
"schema",
"client",
"server"
"server",
"docs"
],
"config": {
"commitizen": {
Expand All @@ -19,10 +20,12 @@
"dev:schema": "pnpm -F schema dev",
"dev:server": "pnpm -F server start:dev",
"dev:client": "pnpm -F client dev",
"dev:docs": "pnpm -F docs start",
"dev": "env-cmd --silent concurrently --kill-others \"pnpm run dev:*\"",
"build:schema": "pnpm -F schema build",
"build:server": "pnpm -F server build",
"build:client": "pnpm -F client build",
"build:docs": "pnpm -F docs build",
"build": "env-cmd --silent concurrently \"pnpm run build:*\"",
"start:server": "pnpm -F server start:prod",
"start:client": "pnpm -F client start",
Expand Down
Loading

0 comments on commit dc4aa0b

Please sign in to comment.