Every component package includes an automated installation script that handles the setup for you.
Installing an Individual Component
After downloading a component package, navigate to your project root directory (where your package.json file is located), extract the package there, and run the install script:
cd /path/to/your/project
unzip ~/Downloads/hero.zip
cd hero
./install.sh
Important: Always extract component packages in your project root directory. The install script needs to be run from within the extracted component folder, but it will copy files to the correct locations (lib/layouts/components/sections/ or lib/layouts/components/_partials/) in your project.
After installation completes successfully, you can safely delete the extracted component folder (e.g., hero/) and the downloaded ZIP file.
The installation script will:
- Verify
nunjucks-components.config.json exists in your project root - Read component paths from your configuration
- Check for existing installations and compare versions
- Validate that required dependencies are installed
- Copy component files to the correct locations
- Report any missing dependencies with download links
Example Installation Output
π§ Installing hero v0.0.1...
Checking dependencies...
β Warning: Missing required partials:
β’ text
β’ ctas
β’ image
Download from: https://nunjucks-components.netlify.app/downloads/
Continue installation anyway? (y/n)
If you proceed, the component files will be installed even if dependencies are missing. You can download the required partials later.
Installing the Complete Bundle
The bundle includes a master installation script with two modes: full install and update-only.
Full Install (Default)
Install all components or update your existing subset:
cd /path/to/your/project
unzip ~/Downloads/nunjucks-components.zip
./nunjucks-components/install-all.sh
Important: The install script requires nunjucks-components.config.json in your project root. Create this file before running the installation (see "Required Configuration" in the Getting Started section above).
If you already have components installed, the script will prompt you to choose:
- Install all components - Adds new components, updates existing ones (52 total)
- Update existing components only - Only updates components you already have (skips new ones)
Update-Only Mode
Only update components you're already using:
./nunjucks-components/install-all.sh --update-only
./nunjucks-components/install-all.sh -u
This mode is perfect for:
- Getting updates for the specific components you use
- Avoiding bloat from components you don't need
- Quick updates when new versions are released
The update-only mode detects installed components by checking for manifest.json files. Only components with matching names will be updated. For example, if you're using one of the starter projects, approximately 22 components will be detected and updated.
The install script automatically:
- Installs all partials first (resolving dependencies)
- Then installs all sections
- Reports which components were installed/updated and which were skipped
- Provides a summary of the installation
After installation completes, you can clean up:
rm -rf nunjucks-components
rm ~/Downloads/nunjucks-components.zip