nqminds / edgesec.info

edgesec tool documentation
https://edgesec.info
MIT License
0 stars 0 forks source link

GitHub Pages

edgesec.info

edgesec tool documentation website

This website is built using Docusaurus 2, a modern static website generator.

Installation

$ npm install

Local Development

$ npm start

This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.

Warning, the search bar does not work in development mode.

Build

$ npm run build

This command generates static content into the build directory and can be served using any static contents hosting service.

You can test the build by running:

$ npm run serve

Deployment

Make a pull request to the main branch of the GitHub repo.

The GitHub Actions CI script will automatically test that your changes will compile correctly. You can then merge into main, where another GitHub Actions CI run will deploy this website using GitHub Pages.

Adding Pages

Creating the page

Pages can be added via adding markdown files to the docs/ folder.

See Docusaurus Markdown Features for markdown features you can use.

Normally, you'd want to place a markdown header into your document, e.g. having the following at the beginning of your markdown file:

---
id: the-url-id # by default, this it path/to/markdown-file
title: Some Cool Title # the title to use in docusaurus links + tab window
hide_title: true # if you already have your title in the text
---
Example **markdown** content

Static Files (e.g. images)

See Docusaurus Website | Static Assets for more info

Images and other static files can be placed in the `./static folder, if you want to host them on the website.

Their url would be the same as their path in the static folder.

E.g., if you place an image in ./static/img/logo.svg, you can show it as a markdown image by entering (replaced /static/ with /):

![My example image](/img/logo.svg)

Adding to the sidebar

After you make your markdown file, you can make a reference to it in the sidebar, by editing ./sidebars.js. You should insert the id of your markdown file.

By default, this id will be the path to your markdown file in the docs folder. e.g. the id of ./docs/capture.md is capture.

Testing and deploying the page

Follow the steps in Installation and Local Development in order to test it locally.

Then follow the steps in Build to make sure the static version works fine.

Finally, commit your changes into a new git branch, push the changes to GitHub, and follow the steps in Deployment to make a pull request and deploy the changes.