An open API service indexing awesome lists of open source software.

https://github.com/paritytech/substrate-website


https://github.com/paritytech/substrate-website

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          



Substrate Logo


Substrate Website


https://substrate.io

[![Netlify Status](https://api.netlify.com/api/v1/badges/f86ac67b-b1aa-41a7-95ec-3a2d14cb3bad/deploy-status)](https://app.netlify.com/sites/substrate-website/deploys)

## Content contribution, PRs and merging flow

- PR providing content (`json`, `md`...): open PR against `main` branch (production)
- PR providing new features: open PR against `main` branch (PR builds in netlify staging env)
- PR providing `hotfixes` open only against `main` (PR builds in netlify staging env)

## Website Architecture (IA /developers)

`NOTE:` Marketplace website has been shut down and it is no longer part of the Substrate website IA.


image

## Development

### Install

Navigate into your cloned local repo directory and install all dependencies.

```shell
yarn
```

**Configure environment variables**

Copy `example.env.development` and rename to `.env.development`

Config URL variables based on your preferable local setup. URL will be used for links generation between Substrate websites.

Default localhost port configuration:

```env
GATSBY_WEBSITE_URL=http://localhost:8100
GATSBY_DOCS_URL=http://localhost:8200
```

**Start development server**

Navigate into your new site’s directory and use the following command to start the development server locally.

```shell
yarn develop
```

## Setup, configuration & plugins

### i18n (bypassed)

Docs:

- https://github.com/microapps/gatsby-plugin-react-i18next#how-to-extract-translations-from-pages
- https://www.i18next.com
- https://react.i18next.com

#### Configuration

You can find the config for i18n, using i18next with `gatsby-plugin-react-i18next`.

- the markdown content is located in `./content/{language}/{content_type}/*`/
- the language strings are located in `./locales/{language}/{data_type}.json`

The default language (and fallback language) is `en` for english.

#### Extract strings

To extract the strings that needs to be translated, it is possible to run `yarn extract-locales`, which will generate the `/locales-tmp` folder.

### netlify-cms (bypassed)

`netlify-cms-app` & `gatsby-plugin-netlify-cms` are used to setup `[netlify-cms](https://www.netlifycms.org)` for this project.

The gatsby gatsby-config pluggin, points to the file `src/cms/index.js`, as entry file of the configuration.

#### local git-gateway backend

To develop and use netlify-cms with the data available in the local repository folder:

In the file `./.env.development` set:

```
GATSBY_NETLIFY_CMS_GIT_LOCAL=true
```

Then in the project's root folder run:

```
npx netlify-cms-proxy-server
```

and in an other shell and the same folder, run the development server as usual.

## Adding, updating and removing content from Ecosystem Projects

Substrate projects can be added, updated, or removed by updating the markdown files located at `content/en/projects`.

To add a new project please add a new markdown file in this folder that follows the naming convention already in place.

To remove a project please remove the appropriate markdown file in `content/en/projects`.

The same editing is available for project types and project categories the markdown for these fields lives in `content/en/project-types` and `content/en/project-categories` respectively. Please use the current markdown structure as a template and guide.