Skip to content

Commit 2844b43

Browse files
committed
feat(config): setup again, add mermaid, code-hike
0 parents  commit 2844b43

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+21846
-0
lines changed

.gitignore

+20
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*

README.md

+41
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.

blog/2019-05-28-first-blog-post.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
slug: first-blog-post
3+
title: First Blog Post
4+
authors: [slorber, yangshun]
5+
tags: [hola, docusaurus]
6+
---
7+
8+
Lorem ipsum dolor sit amet...
9+
10+
<!-- truncate -->
11+
12+
...consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

blog/2019-05-29-long-blog-post.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
slug: long-blog-post
3+
title: Long Blog Post
4+
authors: yangshun
5+
tags: [hello, docusaurus]
6+
---
7+
8+
This is the summary of a very long blog post,
9+
10+
Use a `<!--` `truncate` `-->` comment to limit blog post size in the list view.
11+
12+
<!-- truncate -->
13+
14+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
15+
16+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
17+
18+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
19+
20+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
21+
22+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
23+
24+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
25+
26+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
27+
28+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
29+
30+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
31+
32+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
33+
34+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
35+
36+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
37+
38+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
39+
40+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
41+
42+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
43+
44+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

blog/2021-08-01-mdx-blog-post.mdx

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
slug: mdx-blog-post
3+
title: MDX Blog Post
4+
authors: [slorber]
5+
tags: [docusaurus]
6+
---
7+
8+
Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/markdown-features), such as [MDX](https://mdxjs.com/).
9+
10+
:::tip
11+
12+
Use the power of React to create interactive blog posts.
13+
14+
:::
15+
16+
{/* truncate */}
17+
18+
For example, use JSX to create an interactive button:
19+
20+
```js
21+
<button onClick={() => alert('button clicked!')}>Click me!</button>
22+
```
23+
24+
<button onClick={() => alert('button clicked!')}>Click me!</button>
Loading

blog/2021-08-26-welcome/index.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
slug: welcome
3+
title: Welcome
4+
authors: [slorber, yangshun]
5+
tags: [facebook, hello, docusaurus]
6+
---
7+
8+
[Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog).
9+
10+
Here are a few tips you might find useful.
11+
12+
<!-- truncate -->
13+
14+
Simply add Markdown files (or folders) to the `blog` directory.
15+
16+
Regular blog authors can be added to `authors.yml`.
17+
18+
The blog post date can be extracted from filenames, such as:
19+
20+
- `2019-05-30-welcome.md`
21+
- `2019-05-30-welcome/index.md`
22+
23+
A blog post folder can be convenient to co-locate blog post images:
24+
25+
![Docusaurus Plushie](./docusaurus-plushie-banner.jpeg)
26+
27+
The blog supports tags as well!
28+
29+
**And if you don't want a blog**: just delete this directory, and use `blog: false` in your Docusaurus config.

blog/authors.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
yangshun:
2+
name: Yangshun Tay
3+
title: Front End Engineer @ Facebook
4+
url: https://github.com/yangshun
5+
image_url: https://github.com/yangshun.png
6+
page: true
7+
socials:
8+
x: yangshunz
9+
github: yangshun
10+
11+
slorber:
12+
name: Sébastien Lorber
13+
title: Docusaurus maintainer
14+
url: https://sebastienlorber.com
15+
image_url: https://github.com/slorber.png
16+
page:
17+
# customize the url of the author page at /blog/authors/<permalink>
18+
permalink: '/all-sebastien-lorber-articles'
19+
socials:
20+
x: sebastienlorber
21+
linkedin: sebastienlorber
22+
github: slorber
23+
newsletter: https://thisweekinreact.com

blog/tags.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
facebook:
2+
label: Facebook
3+
permalink: /facebook
4+
description: Facebook tag description
5+
6+
hello:
7+
label: Hello
8+
permalink: /hello
9+
description: Hello tag description
10+
11+
docusaurus:
12+
label: Docusaurus
13+
permalink: /docusaurus
14+
description: Docusaurus tag description
15+
16+
hola:
17+
label: Hola
18+
permalink: /hola
19+
description: Hola tag description

docs/about.md

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
sidebar_position: 5
3+
sidebar_label: "About These Docs"
4+
slug: "about-these-docs"
5+
title: "About These Docs"
6+
---
7+
import { Highlight } from "../src/components/Highlight";
8+
9+
# ✏️️ Contributing
10+
11+
These docs are built with [Docusaurus](https://github.com/facebook/docusaurus) and deployed to GitHub Pages. Check
12+
out [this page](https://docusaurus.io/docs/create-doc) to read more about how to create pages with Docusaurus.
13+
It offers many features out of the box which made it easy to adopt, such as versioning, i18n, and search.
14+
15+
**To make changes to files**, click the "Edit this Page" link at the bottom of any page. This will prompt you to create a pull request on GitHub with your proposed changes. Alternatively, you can edit the file directly from GitHub and create the pull request from there.
16+
17+
## Running Docs Locally
18+
19+
If you'd like to run the docs locally, you should clone the repo to your laptop.
20+
21+
### GitHub Repo
22+
23+
The repository for these docs lives here: [securesign/ssc-hub](https://github.com/securesign/ssc-hub)
24+
25+
### What you'll need
26+
27+
- [Node.js](https://nodejs.org/en/download/) version 18.0 or above:
28+
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
29+
30+
### Start the site
31+
32+
Run the development server:
33+
34+
```bash
35+
npm run start
36+
```
37+
38+
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.
39+
40+
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/.
41+
42+
Open `docs/intro.md` and edit some lines: the site **reloads automatically** and displays your changes.
43+
44+
## Deploying Changes
45+
46+
Changes are published automatically on push to the `main` branch of the [securesign/ssc-hub](https://github.com/securesign/ssc-hub) repository, which is private to members of the `securesign` org. The workflow responsible for deployment is located here: [.github/workflows/deploy.yml](https://github.com/securesign/ssc-hub/blob/main/.github/workflows/deploy.yml)
47+
48+
The docs are deployed using [GitHub Pages](https://pages.github.com/) and are private thanks to Red Hat having an enterprise plan. Check the [repo Pages settings](https://github.com/securesign/ssc-hub/settings/pages) for additional info.
49+
50+
## How to add new things
51+
52+
### Add a new page to an existing category in the sidebar
53+
54+
Simply drop a Markdown (or MDX) file in the category directory. For example, if you want to add a new page to "Resources", you would add the file to `docs/resources` directory.
55+
56+
:::info
57+
Make sure your Markdown file contains a `h1` header, as otherwise it will just use the name of the file, which is usually ugly.
58+
:::
59+
60+
### Add a new category in the sidebar
61+
62+
1. Create a new folder within the `docs` directory with the name of the path you want (i.e. `http://localhost:3000/new-category/`)
63+
2. Add a `_category_.json` file (you can use the other categories as an example) and populate it as follows:
64+
65+
```json
66+
{
67+
"label": "Example",
68+
"position": 80,
69+
"link": {
70+
"type": "generated-index",
71+
"description": "Some example description."
72+
}
73+
}
74+
```
75+
76+
The `position` property determines where in the sidebar it appears in relation to the other categories. Try to use increments of 10 or 20, when possible.
77+
78+
3. Add a Markdown file in the new directory (i.e. `docs/new-category/some-page.md`)
79+
4. If there were no errors, the page will now be available at `http://localhost:3000/new-category/some-page`
80+
81+
### Add a new top-level navigation item
82+
83+
At the very top there is a navigation bar with a few menu items, a search bar, and a few other things. We mainly use the `docs` page, but if you'd like to add a new item, you can add a markdown file with the item under `src/pages`. Here is an example of the one used to create the F2F page (`src/pages/f2f.md`):
84+
85+
```markdown
86+
---
87+
slug: /about
88+
title: About
89+
---
90+
91+
# About
92+
93+
This is my example page.
94+
```
95+
96+
If you'd like to add a completely new custom style page (similar to how we do for the Blog), have a look at how we do it for the blog (`blog` folder in root of directory).
97+
98+
### Add a new Mermaid diagram
99+
100+
[Mermaid](https://mermaid.js.org/syntax/flowchart.html) is supported by Markdown and Docusaurus, meaning you can now create a diagram from anywhere in the repo with a simple code block:
101+
102+
```
103+
```mermaid
104+
flowchart LR
105+
A -- text --> B -- text2 --> C
106+
```
107+
108+
Which will render the following:
109+
110+
```mermaid
111+
flowchart LR
112+
A -- text --> B -- text2 --> C
113+
```
114+
115+
Mermaid supports several types of diagrams, not just flowcharts. If you'd like to play around with Mermaid, there is a live editor [here](https://mermaid-js.github.io/).
116+
117+
### Add an interactive React component
118+
119+
Docusaurus lets you add interactivity via [MDX](https://mdxjs.com/), which allows you to write JSX within your Markdown files and render them as React components. All you have to do is name your file using the `.mdx` extension instead of `.md` and include your component as usual.
120+
121+
Here is an example:
122+
123+
<Highlight color="#25c2a0">This is highlighted</Highlight> and <Highlight color="#1877F2">so is this</Highlight>, using a custom `<Highlight/>` component in the `src/components` directory.
124+
125+
I can write **Markdown** alongside my _JSX_!

docs/intro.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Tutorial Intro
6+
7+
Let's discover **Docusaurus in less than 5 minutes**.
8+
9+
## Getting Started
10+
11+
Get started by **creating a new site**.
12+
13+
Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
14+
15+
### What you'll need
16+
17+
- [Node.js](https://nodejs.org/en/download/) version 18.0 or above:
18+
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
19+
20+
## Generate a new site
21+
22+
Generate a new Docusaurus site using the **classic template**.
23+
24+
The classic template will automatically be added to your project after you run the command:
25+
26+
```bash
27+
npm init docusaurus@latest my-website classic
28+
```
29+
30+
You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.
31+
32+
The command also installs all necessary dependencies you need to run Docusaurus.
33+
34+
## Start your site
35+
36+
Run the development server:
37+
38+
```bash
39+
cd my-website
40+
npm run start
41+
```
42+
43+
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.
44+
45+
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/.
46+
47+
Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.

0 commit comments

Comments
 (0)