Deploying as a Static Website

You can deploy your documentation portal as a static website.

  • A static website supports only one catalog at a time.

  • The following features are unavailable for static sites:

  • Gramax CLI is used for generating static websites based on content created in Gramax.

Prerequisites

  • Node.js version 18 or higher (required for CLI).

  • A text editor, such as Visual Studio Code.

  • A terminal.

Quick Start

  1. Install Gramax CLI: npm install -g gramax-cli.

  2. Generate the static site: gramax-cli build --source ./content --destination ./output.

Detailed Steps

Step 1: Install Gramax CLI

Gramax CLI can be used in two ways:

  1. Without installation: Run commands using npx: npx gramax-cli <command> [options].

  2. Global installation: For frequent use, install it globally: npm install -g gramax-cli.

After installation, CLI commands are available from any directory.

Step 2: Generate the Static Site

To generate the static site, run: gramax-cli build --source ./content --destination ./output.

Where:

  • --source specifies the content folder path (defaults to the current directory).

  • --destination specifies the output folder path for the generated site (defaults to ./build).

Optional Configuration:

  1. Create a gramax.config.yaml file in the content folder:

    build: logo: imageUrl: 'https://example.com/logo.png' linkUrl: 'https://example.com' metrics: matomo: matomoSiteId: 1 matomoUrl: 'https://example.com/matomo' matomoContainerUrl: 'https://example.com/container'
  2. Environment variables:

    • Linux/macOS:

      export LOGO_IMAGE_URL='https://example.com/logo.png' export LOGO_LINK_URL='https://example.com' source ~/.bashrc

      and for metrics, the corresponding, MATOMO_SITE_ID, MATOMO_URL and MATOMO_CONTAINER_URL

    • Windows:

      [System.Environment]::SetEnvironmentVariable('LOGO_IMAGE_URL', 'https://example.com/logo.png', 'User')