Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docusaurus #138

Merged
merged 8 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -453,3 +453,16 @@ obj/
# End of https://www.toptal.com/developers/gitignore/api/dotnetcore,csharp

sdk/**/launchSettings.json

# dependencies
website/node_modules

# production
website/build

# generated files
website/.docusaurus
.cache-loader
website/npm-debug.log*
website/yarn-debug.log*
website/yarn-error.log*
6 changes: 6 additions & 0 deletions docs/home.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: home
title: "Homepage"
---

Welcome to TraderX!
9 changes: 9 additions & 0 deletions docs/roadmap.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
id: roadmap
title: "TraderX Roadmap"
---

This is the TraderX Roadmap:
1. ...
2. ...
3. ...
9 changes: 9 additions & 0 deletions docs/team.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
id: team
title: "TraderX Team"
---

This is the TraderX team:
1. ...
2. ...
3. ...
2 changes: 2 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../{docs,website}/"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheJuanAndOnly99 , we tried quite a few combination of this - and ended up just by using /bin/false . If you figure out a working setup (that works for the draft pages too and for normal, etc), I am super interested.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @psmulovics not sure I understand what you mean by draft vs normal pages. The objective here is to only run Netlify on PRs that contain changes to the docs and website folders.

1 change: 1 addition & 0 deletions website/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps=true
26 changes: 26 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
This website was created with [Docusaurus v2](https://v2.docusaurus.io/).

In order to start working with Docusaurus, please read the [Getting Started guide](https://docusaurus.io/docs/configuration) and browse through the following folders and files:
- `website` - contains the Node/React code to build the website
- `website/docusaurus.config.js` - contains the Docusaurus configuration; you'll need to edit this file.
- `website/static` - contains images, PDF and other static assets used in the website; if you add a `file.pdf` in this folder, it will be served as `https://<your_host>/file.pdf`.
- `docs` - contains the `.md` and `.mdx` files that are served as `https://<your_host>/<file_id>` ; the `file_id` is defined at the top of the file.

## Local run

Running Docusaurus locally is very simple, just follow these steps:
- Make sure `node` version is 14 or higher, using `node -v` ; you can use [nvm](https://github.com/nvm-sh/nvm) to install different node versions in your system.
- `cd website ; npm install ; npm run start`

The command should open your browser and point to `http://localhost:3000`.

## Deployment

[Netlify] (https://www.netlify.com/) is the default way to serve FINOS websites publicly. Find docs [here] (https://docs.netlify.com/configure-builds/get-started/).

You can configure Netlify using your own GitHub account, pointing to a personal repository (or fork); when adding a new site, please use the following configuration:
- Woeking directory: `website`
- Build command: `yarn build`
- Build directory: `website/build`

If you want to serve your website through `https://<project_name>.finos.org`, please email [[email protected]](mailto:[email protected]). To check a preview, visit https://project-blueprint.finos.org .
118 changes: 118 additions & 0 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
// Docs at https://docusaurus.io/docs

const projectName = 'TraderX'
const projectSlug = 'traderX'
const copyrightOwner = 'FINOS - The Fintech Open Source Foundation'

module.exports = {
onBrokenLinks: 'ignore',
title: `${projectName}`,
tagline: `${projectName}`,
url: 'https://finos.org',
baseUrl: '/',
trailingSlash: false,
favicon: 'img/favicon/favicon-traderX.ico',
projectName: `${projectName}`,
organizationName: 'FINOS',
customFields: {
repoUrl: `https://github.com/finos/${projectSlug}`,
},
scripts: ['https://buttons.github.io/buttons.js'],
stylesheets: ['https://fonts.googleapis.com/css?family=Overpass:400,400i,700'],
themeConfig: {
navbar: {
title: `TraderX`,
logo: {
alt: 'TraderX Logo',
src: 'img/favicon/favicon-traderX.ico',
},
items: [
{to: 'docs/home', label: 'Docs', position: 'right'},
{to: 'docs/roadmap', label: 'Roadmap', position: 'right'},
{to: 'docs/team', label: 'Team', position: 'right'},
{
href: 'https://github.com/finos/',
label: 'GitHub',
position: 'right',
}
],
},
footer: {
copyright: `Copyright © ${new Date().getFullYear()} TraderX - ${copyrightOwner}`,
logo: {
alt: 'FINOS Logo',
src: 'img/favicon/favicon-finos.ico',
href: 'https://finos.org'
},
links: [
{
title: 'Docs',
items: [
{
label: 'Getting Started',
to: 'docs/home',
},
{
label: 'Roadmap',
to: 'docs/roadmap',
},
{
label: 'Team',
to: 'docs/team',
}
]
},
{
title: 'FINOS',
items: [
{
label: 'FINOS Website',
to: 'https://www.finos.org/',
},
{
label: 'Community Handbook',
to: 'https://community.finos.org/',
},
{
label: 'FINOS Projects',
to: 'https://landscape.finos.org',
}
]
},
{
title: 'About FINOS',
items: [
{
label: 'FINOS Projects on GitHub',
to: 'https://github.com/finos',
},
{
label: 'Engage the FINOS Community',
to: 'https://www.finos.org/engage-with-our-community',
},
{
label: 'FINOS News and Events',
to: 'https://www.finos.org/news-and-events',
}
]
},
]
},
},
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
path: '../docs',
editUrl:
'https://github.com/finos/traderX/edit/main/website/',
sidebarPath: require.resolve('./sidebars.js')
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
}
}
]
]
};
41 changes: 41 additions & 0 deletions website/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"scripts": {
"docusaurus": "docusaurus",
"deploy": "docusaurus deploy",
"serve": "docusaurus serve",
"clear": "docusaurus clear",
"start": "docusaurus start",
"swizzle": "docusaurus swizzle",
"build": "docusaurus build",
"publish-gh-pages": "docusaurus deploy"
},
"dependencies": {
"@docusaurus/core": "^3.2.0",
"@docusaurus/preset-classic": "^3.2.0",
"ajv": "^8.12.0",
"classnames": "^2.5.1",
"clsx": "^2.0.0",
"prism-react-renderer": "^2.3.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"eslint": "^8.0.0",
"eslint-plugin-react": "^7.23.2"
},
"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": ">=18.0"
}
}
5 changes: 5 additions & 0 deletions website/sidebars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
mainSidebar: {
'Main Menu': ["home", "team", "roadmap"]
},
}
20 changes: 20 additions & 0 deletions website/src/components/HomepageFeatures.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.features {
display: flex;
align-items: center;
padding: 2rem 0;
width: 100%;
}

.featureSvg {
height: 200px;
width: 200px;
}

.divider {
border: 100000px solid #000 !important;
}

.furtherReading {
display: flex;
flex-direction: column;
}
Loading