mirror of
https://github.com/wavetermdev/docusaurus-og.git
synced 2026-08-05 13:46:35 -07:00
development updates.
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
- [Description](#description)
|
||||
- [Installation](#installation)
|
||||
- [Usage](#usage)
|
||||
- [Development Guides](#development-guides)
|
||||
- [Run locally](#run-locally)
|
||||
- [Versioning](#versioning)
|
||||
- [Packages](#packages)
|
||||
- [TODO](#todo)
|
||||
|
||||
# Description
|
||||
|
||||
This monorepo contains a set of [Docusaurus 2](https://docusaurus.io/) plugins and themes developed for Logos documentation websites.
|
||||
|
||||
# Installation
|
||||
|
||||
Clone this repository and install the dependencies by running the following:
|
||||
|
||||
```bash
|
||||
$ yarn
|
||||
```
|
||||
|
||||
# Usage
|
||||
|
||||
Clone our ready-to-use [Docusaurus template](https://github.com/acid-info/logos-documentation-website-template).
|
||||
|
||||
# Development Guides
|
||||
|
||||
## Run locally
|
||||
|
||||
To make the development easier and to remove the need to locally link an external repository to the packages in this project, we've created a playground Docusaurus website which can be found in `packages/docusaurus-playground`.
|
||||
|
||||
[Lerna](https://lerna.js.org/) will handle linking the packages; however, if you want to use them in another project, you should use tools like [yarn link](https://classic.yarnpkg.com/en/docs/cli/link) or [yalc](https://github.com/wclr/yalc); but please be careful not to commit changes made by these tools.
|
||||
|
||||
1. Install dependencies and link packages together:
|
||||
|
||||
```bash
|
||||
$ yarn && yarn bootstrap
|
||||
```
|
||||
|
||||
2. Build packages:
|
||||
|
||||
```bash
|
||||
$ yarn build
|
||||
|
||||
# or build and watch for changes
|
||||
|
||||
$ yarn watch
|
||||
```
|
||||
|
||||
2. Start the playground website:
|
||||
|
||||
```bash
|
||||
$ yarn start
|
||||
```
|
||||
|
||||
## Versioning
|
||||
|
||||
We use semantic versioning; all you need to do is commit your changes and then run the following command:
|
||||
|
||||
```bash
|
||||
$ yarn lerna version --no-private
|
||||
```
|
||||
|
||||
# Packages
|
||||
|
||||
- **Presets**
|
||||
|
||||
- [Logos Preset](./packages/logos-docusaurus-preset) [](https://www.npmjs.com/package/@acid-info/logos-docusaurus-preset)
|
||||
|
||||
- **Plugins**
|
||||
|
||||
- [Logos Search Local](./packages/logos-docusaurus-search-local) [](https://www.npmjs.com/package/@acid-info/logos-docusaurus-search-local)
|
||||
|
||||
- **Themes**
|
||||
- [Logos Theme](./packages/logos-docusaurus-theme) [](https://www.npmjs.com/package/@acid-info/logos-docusaurus-theme)
|
||||
|
||||
# TODO
|
||||
|
||||
- [ ] Automate publishing
|
||||
- [ ] Add unit testing
|
||||
- [ ] Optimize [Logos theme](./packages/logos-docusaurus-theme)'s watch command
|
||||
+3
-2
@@ -8,8 +8,9 @@
|
||||
],
|
||||
"scripts": {
|
||||
"bootstrap": "lerna bootstrap",
|
||||
"build": "lerna run build",
|
||||
"watch": "lerna run watch",
|
||||
"watch": "lerna --ignore docusaurus-playground run watch",
|
||||
"build": "lerna --ignore docusaurus-playground run build",
|
||||
"start": "lerna --scope docusaurus-playground run start",
|
||||
"prepare": "husky install",
|
||||
"prettier": "pretty-quick",
|
||||
"prettier:staged": "pretty-quick --staged"
|
||||
|
||||
@@ -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*
|
||||
@@ -0,0 +1,41 @@
|
||||
# Website
|
||||
|
||||
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
|
||||
|
||||
### Installation
|
||||
|
||||
```
|
||||
$ yarn
|
||||
```
|
||||
|
||||
### Local Development
|
||||
|
||||
```
|
||||
$ yarn start
|
||||
```
|
||||
|
||||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
|
||||
|
||||
### Build
|
||||
|
||||
```
|
||||
$ yarn build
|
||||
```
|
||||
|
||||
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
||||
|
||||
### Deployment
|
||||
|
||||
Using SSH:
|
||||
|
||||
```
|
||||
$ USE_SSH=true yarn deploy
|
||||
```
|
||||
|
||||
Not using SSH:
|
||||
|
||||
```
|
||||
$ GIT_USER=<Your GitHub username> yarn deploy
|
||||
```
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
---
|
||||
title: Intro
|
||||
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 16.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.
|
||||
@@ -0,0 +1,44 @@
|
||||
// @ts-check
|
||||
// Note: type annotations allow type checking and IDEs autocompletion
|
||||
require('dotenv').config()
|
||||
|
||||
/** @type {import('@docusaurus/types').Config} */
|
||||
const config = {
|
||||
title: 'TITLE',
|
||||
url: 'https://url',
|
||||
baseUrl: '/',
|
||||
|
||||
customFields: {
|
||||
ghostAPiKey: process.env.GHOST_API_KEY,
|
||||
},
|
||||
|
||||
// Even if you don't use internalization, you can use this field to set useful
|
||||
// metadata like html lang. For example, if your site is Chinese, you may want
|
||||
// to replace "en" with "zh-Hans".
|
||||
i18n: {
|
||||
defaultLocale: 'en',
|
||||
locales: ['en'],
|
||||
},
|
||||
|
||||
presets: [
|
||||
[
|
||||
'@acid-info/logos-docusaurus-preset',
|
||||
/** @type {import('@acid-info/logos-docusaurus-preset').PluginOptions} */
|
||||
({
|
||||
businessUnit: 'Codex',
|
||||
theme: {
|
||||
name: 'default',
|
||||
options: {
|
||||
customCss: [require.resolve('./src/css/custom.scss')],
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
],
|
||||
|
||||
themeConfig:
|
||||
/** @type {import('@acid-info/logos-docusaurus-preset').ThemeConfig} */
|
||||
({}),
|
||||
}
|
||||
|
||||
module.exports = config
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "docusaurus-playground",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"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": {
|
||||
"@acid-info/logos-docusaurus-preset": "^0.1.6",
|
||||
"@docusaurus/core": "2.1.0",
|
||||
"@docusaurus/preset-classic": "2.1.0",
|
||||
"@mdx-js/react": "^1.6.22",
|
||||
"clsx": "^1.2.1",
|
||||
"prism-react-renderer": "^1.3.5",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"tsdx": "^0.14.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "2.1.0",
|
||||
"@tsconfig/docusaurus": "^1.0.5",
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.5%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.14"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from '@acid-info/logos-docusaurus-theme/lib/client/components/mdx'
|
||||
@@ -0,0 +1,2 @@
|
||||
:root {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
// This file is not used in compilation. It is here just for a nice editor experience.
|
||||
"extends": "@tsconfig/docusaurus/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "."
|
||||
}
|
||||
}
|
||||
@@ -11,13 +11,12 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"cleanup": "yarn cleanup",
|
||||
"watch": "yarn gulp watch",
|
||||
"clean": "yarn clean",
|
||||
"build": "yarn gulp build",
|
||||
"build:watch": "yarn gulp watch --command 'yarn build'",
|
||||
"watch": "yarn gulp watch --command 'yarn build'",
|
||||
"build:client": "yarn gulp build-client && yarn gulp client-post-build",
|
||||
"build:server": "yarn gulp build-server",
|
||||
"prepublishOnly": "yarn build"
|
||||
"prepublishOnly": "yarn clean && yarn build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@acid-info/logos-docusaurus-preset": "^0.1.6",
|
||||
|
||||
Reference in New Issue
Block a user