How to contribute to the developer portal
We wanted to build an open and inclusive, easy to use developer portal that offers guidance and allows community contribution. To achieve this we have chosen Docusaurus 2, a modern static website generator.
#
InstallationTo contribute to the Cardano developer portal, you must first install it locally.
#
Requirements- Node.js version >= 12.13.0 or above (which can be checked by running
node -v
). You can use nvm for managing multiple Node versions on a single machine installed. - Yarn version >= 1.5 (which can be checked by running
yarn --version
). Yarn is a performant package manager for JavaScript and replaces thenpm
client. It is not strictly necessary but highly encouraged. - On macOS you also need Xcode and Command Line Tools.
#
Local developmentTo get a local development environment, clone the repository, navigate into the developer-portal
folder, install dependencies, and start the development server. Most changes are reflected live without having to restart the server. By default, a browser window will open at http://localhost:3000
.
git clone https://github.com/cardano-foundation/developer-portal.gitcd developer-portalyarn installyarn start
Limitations of the development build
The development mode will have minor features not working. For example, only blurry images in the responsive images on showcase and tools, search limitations, and some data has fake values because of performance reasons.
#
Production buildyarn build
Use this command instead of yarn start
to generate static content into the build directory that can be served using any static content hosting service.
#
Project structureThe portal is structured as follows. (See the Project structure rundown below for details)
developer-portalโโโ blogโ โโโ 2021-01-07-january.mdโ โโโ 2021-02-03-february.mdโ โโโ *.mdโโโ docsโ โโโ fund-your-projectโ โโโ get-startedโ โโโ integrate-cardanoโ โโโ native-tokensโ โโโ operate-a-stake-poolโ โโโ stake-pool-courseโ โโโ transaction-metadataโ โโโ *.mdโโโ examplesโ โโโ cliโ | โโโ dotnetโ โ โ โโโ *.csโ | โโโ jsโ โ โ โโโ *.js| | โโโ pythonโ โ โโโ *.py| โโโ walletsโ โโโ dotnetโ โโโ js| โโโ pythonโโโ srcโ โโโ cssโ โ โโโ custom.cssโ โโโ dataโ โ โโโ builder-toolsโ โ โ โโโ *.pngโ โ โโโ showcaseโ โ โ โโโ *.pngโ โ โโโ builder-tools.jsโ โ โโโ showcases.jsโ โโโ pagesโ โโโ styles.module.cssโ โโโ index.jsโโโ staticโ โโโ imgโโโ docusaurus.config.jsโโโ package.jsonโโโ README.mdโโโ sidebars.jsโโโ yarn.lock
#
Project structure rundown/blog/
- Contains the blog Markdown files for the developer spotlight./docs/
- Contains the Markdown files for the docs. Customize the order of the docs sidebar insidebars.js
./examples/
- Contains example projects for the Markdown files in the docs. The structure is not final and will likely change in the future/src/
- Non-documentation files like pages or custom React components. You don't have to strictly put your non-documentation files in here, but putting them under a centralized directory makes it easier to specify in case you need to do some sort of linting/processing./src/data/builder-tools
- Screenshots for the builder tools section./src/data/builder-tools.js
- Definition file for the builder tools section./src/data/showcase
- Screenshots for the showcase section./src/data/showcase.js
- Definition file for the showcase section./src/pages
- Any files within this directory will be converted into a website page.
/static/
- Static directory. Any contents inside here will be copied into the root of the finalbuild
directory./docusaurus.config.js
- A config file containing the site configuration./package.json
- A Docusaurus website is a React app. You can install and use any npm packages you like in them./sidebar.js
- Used by the documentation to specify the order of documents in the sidebar.