Skip to content

Commit

Permalink
docs: add docusaurus website
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilherme Ferreira committed Jan 22, 2024
1 parent 99e8e7b commit 4498082
Show file tree
Hide file tree
Showing 27 changed files with 23,430 additions and 12 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added .github/.DS_Store
Binary file not shown.
37 changes: 37 additions & 0 deletions .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main
- release-*

workflow_dispatch:

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache-dependency-path: website/yarn.lock

- name: Install dependencies
working-directory: ./website
run: yarn install --frozen-lockfile

- name: Build website
working-directory: ./website
run: yarn build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/build
25 changes: 25 additions & 0 deletions .github/workflows/test-deploy-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test deployment

on:
pull_request:

jobs:
test-deploy:
name: Test deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache-dependency-path: website/yarn.lock

- name: Install dependencies
working-directory: ./website
run: yarn install --frozen-lockfile

- name: Test build website
working-directory: ./website
run: yarn build
Binary file added data/.DS_Store
Binary file not shown.
Binary file added src/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Builder
public static class IServiceCollectionExtensions
{
/// <summary>
/// Extension to configure the Load Shedding options.
/// Extension to configure the LoadShedding options.
/// </summary>
/// <param name="services">The IServiceCollection instance.</param>
/// <param name="configDelegate">The configuration action.</param>
Expand All @@ -36,7 +36,7 @@ public static IServiceCollection AddLoadShedding(
}

/// <summary>
/// Extension to configure the Load Shedding options.
/// Extension to configure the LoadShedding options.
/// </summary>
/// <param name="services">The IServiceCollection instance.</param>
/// <param name="configDelegate">The configuration action.</param>
Expand All @@ -47,7 +47,7 @@ public static IServiceCollection AddLoadShedding(this IServiceCollection service
}

/// <summary>
/// Extension to configure the Load Shedding options.
/// Extension to configure the LoadShedding options.
/// </summary>
/// <param name="services">The IServiceCollection instance.</param>
/// <returns>IServiceCollection</returns>
Expand Down
Binary file added tests/.DS_Store
Binary file not shown.
20 changes: 20 additions & 0 deletions website/.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*
41 changes: 41 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus](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.
3 changes: 3 additions & 0 deletions website/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')],
};
7 changes: 7 additions & 0 deletions website/docs/getting-started/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"label": "Getting Started",
"position": 2,
"link": {
"type": "generated-index"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Load Shedding Installation
---
sidebar_position: 1
---
# Installation

To start using the LoadShedding library, just install the following package to the Startup Project:

Expand All @@ -19,7 +22,3 @@ Use the `UseLoadShedding` extension method by extending the `IApplicationBuilder
```csharp
app.UseLoadShedding();
```

------

Go back to [Documentation Index](/../#documentation)
6 changes: 6 additions & 0 deletions website/docs/getting-started/quickstart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
sidebar_position: 2
sidebar_label: Quickstart
---

# Quickstart
7 changes: 7 additions & 0 deletions website/docs/guides/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"label": "Guides",
"position": 3,
"link": {
"type": "generated-index"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
sidebar_position: 1
---

# Register Concurrency Adaptative Limiter

The concurrency adaptative limiter provides a capacity to auto-adjust the accepted traffic based on the runtime performance, ensuring that latencies remain low.
Expand Down Expand Up @@ -240,7 +244,3 @@ options.AddMetrics(options =>
| http_requests_queue_limit_total | The current queue limit size | gauge | |
| http_requests_queue_time_seconds | The time each request spent in the queue until its executed | histogram | method (HTTP method of the request), priority (critical, noncritical, normal) |
| http_requests_rejected_total | The number of requests rejected because the queue limit is reached | counter | method (HTTP method of the request), priority (critical, noncritical, normal), reason (max_queue_items, queue_timeout) |

------

Go back to [Documentation Index](/../#documentation)
27 changes: 27 additions & 0 deletions website/docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
sidebar_position: 1
sidebar_label: Introduction
slug: /
---

# Introduction to LoadShedding

...

Get started by installing [LoadShedding](getting-started/installation) or following our [Quickstart](getting-started/quickstart).

## Features {#features}

...

## Join the community {#join-the-community}

- [GitHub](https://github.com/farfetch/loadshedding): For new feature requests, bug reporting or contributing with your own pull request.

## Something missing here? {#something-missing}

If you have suggestions to improve the documentation, please send us a new [issue](https://github.com/farfetch/loadhshedding/issues).

## License

LoadShedding is a free and open-source project, released under the permissible [MIT license](https://github.com/Farfetch/loadshedding/blob/main/LICENSE).
131 changes: 131 additions & 0 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
// @ts-check
// `@type` JSDoc annotations allow editor autocompletion and type checking
// (when paired with `@ts-check`).
// There are various equivalent ways to declare your Docusaurus config.
// See: https://docusaurus.io/docs/api/docusaurus-config

import {themes as prismThemes} from 'prism-react-renderer';

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'FARFETCH LoadShedding',
tagline: 'A .NET LoadShedding Library',
favicon: 'img/favicon.ico',

// Set the production url of your site here
url: 'https://farfetch.github.io/',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'Farfetch', // Usually your GitHub org/user name.
projectName: 'loadshedding', // Usually your repo name.

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',

// Even if you don't use internationalization, 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: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
routeBasePath: '/', // Serve the docs at the site's root
sidebarPath: './sidebars.js',
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/farfetch/loadhsedding/tree/main/website/',
},
blog: false,
theme: {
customCss: './src/css/custom.css',
},
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
colorMode: {
defaultMode: 'light',
disableSwitch: true,
},
navbar: {
logo: {
alt: 'LoadShedding',
src: 'img/logo.svg',
},
items: [
{
href: 'https://github.com/farfetch/loadshedding',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Introduction',
to: '/',
},
{
label: 'Getting Started',
to: '/category/getting-started',
},
{
label: 'Guides',
to: '/category/guides',
}
]
},
{
title: 'Community',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/loadshedding',
},
],
},
{
title: 'More',
items: [
{
label: 'FARFETCH Blog',
to: 'https://farfetchtechblog.com',
},
{
label: 'GitHub',
href: 'https://github.com/farfetch/loadshedding',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} FARFETCH UK Limited. Built with Docusaurus.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
additionalLanguages: ['csharp']
},
}),
};

export default config;
Loading

0 comments on commit 4498082

Please sign in to comment.