Set Environment Variables
This guide explains how to set the PROJECT_NAME and ORG_NAME environment variables needed for the contributors section to work properly.
Why These Variables Are Needed
The contributors component uses these environment variables to:
- Generate the correct GitHub repository URL
- Display contributor avatars from contrib.rocks
- Link to your project's contributors page
Setting Environment Variables
macOS and Linux (including GitHub Codespaces)
Temporary (Current Session Only)
Open your terminal and run:
export ORG_NAME="your-github-username"
export PROJECT_NAME="your-repository-name"
For example:
export ORG_NAME="facebook"
export PROJECT_NAME="docusaurus"
Permanent (All Sessions)
Add the exports to your shell profile file:
For Bash (~/.bashrc or ~/.bash_profile):
echo 'export ORG_NAME="your-github-username"' >> ~/.bashrc
echo 'export PROJECT_NAME="your-repository-name"' >> ~/.bashrc
source ~/.bashrc
For Zsh (~/.zshrc):
echo 'export ORG_NAME="your-github-username"' >> ~/.zshrc
echo 'export PROJECT_NAME="your-repository-name"' >> ~/.zshrc
source ~/.zshrc
Windows
Command Prompt (Temporary)
set ORG_NAME=your-github-username
set PROJECT_NAME=your-repository-name
Command Prompt (Permanent)
setx ORG_NAME "your-github-username"
setx PROJECT_NAME "your-repository-name"
PowerShell (Temporary)
$env:ORG_NAME="your-github-username"
$env:PROJECT_NAME="your-repository-name"
PowerShell (Permanent)
[Environment]::SetEnvironmentVariable("ORG_NAME", "your-github-username", "User")
[Environment]::SetEnvironmentVariable("PROJECT_NAME", "your-repository-name", "User")
Windows GUI Method
- Right-click "This PC" or "Computer" and select "Properties"
- Click "Advanced system settings"
- Click "Environment Variables"
- Under "User variables", click "New"
- Add
ORG_NAMEwith your GitHub username as the value - Click "New" again and add
PROJECT_NAMEwith your repository name as the value - Click "OK" to save
Verifying Your Setup
After setting the variables, verify they're correctly set:
macOS/Linux/GitHub Codespaces:
echo $ORG_NAME
echo $PROJECT_NAME