This guide will walk you through the installation process and help you set up your first CampsiteJS static site. We’ll cover the prerequisites, installation steps, and how to create your first site.
Prerequisites
Before you begin, ensure you have the following installed on your machine:
- Node.js: CampsiteJS requires Node.js version 14 or higher. You can download it from nodejs.org.
- npm or yarn: npm comes bundled with Node.js, but you can also use yarn as an alternative package manager. You can install yarn from yarnpkg.com.
- Git: While not strictly necessary, having Git installed is recommended for version control and managing your CampsiteJS projects. You can download it from git-scm.com.
Basic Setup without CLI
If you prefer not to use the CampsiteJS CLI, you can set up a CampsiteJS project manually by following these steps:
Simply run the following commands in your terminal:
npm create campsitejs@latest
Global Installation Steps
To create your first CampsiteJS site, follow these steps:
- Install Campsite: Use npm or yarn to install CampsiteJS globally.
npm install -g campsitejs@latest - Create a New Site: Run the following command to create a new CampsiteJS project.
campsitejs my-site - Navigate to Your Site: Change into your new site directory.
cd my-site - Start the Development Server: Launch the development server to preview your site.
npm run dev - Build for Production: When you’re ready to deploy, build your site with:
The output will be in thenpm run build./campfire/folder, this can be changed in yourcampsite.config.jsfile by modifying theoutputDirproperty.
Next Steps
Continue your adventure with CampsiteJS by exploring the deployment guide.