Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Initializing a new site
When first starting out with Solidus it's highly recommended that you use the Solidus Site Template to initialize your site. In order to use this, you'll need to install a few things first:
- Grunt, a task-runner built in Node.js. This can do things like compile Sass and run Livereload.
- Grunt Init, a project templating solution. This lets you initialize a new project with a preset file structure.
- The Solidus Site Template itself.
grunt-init is a CLI, or Command Line Interface. This means that you'll need to use terminal/bash/cmd to run it. If you're not familiar with CLI, you should probably take some time to get acquainted, as Solidus makes liberal use of it as well. Once you've got the above installed, all you need to do is grab the Solidus Site Template and run
grunt-init with it. First, make sure you know where you copied the site template to (or "install" the template), then navigate your terminal to a new folder and run the
grunt-init command with the path to your template:
grunt-init will then ask you a series of questions to help you set up your site. Things in parentheses are the default answers to these questions (so you don't need to do anything but hit enter if the default answer is sufficient). Here's how it should go:
Please answer the following: [?] Project name (example) [?] Project title (Example) [?] Do you need to make any changes to the above before continuing? (y/N) Writing .gitignore...OK Writing Gruntfile.js...OK ... Initialized from template "solidus-site-template". \o/ You did it!
Once you see this, your new site is initialized and ready to be worked on. If everything worked right, you should have a file structure like this:
||Special folder for Node.js modules. You won't need to interact with this at all|
||Contains resource preprocessors.|
||Contains all [[pages|
||File needed to configure
||Special files for Node.js modules. This probably won't need to be edited.|
||An empty readme file. A good place to document the development of the site for whoever else might work on it.|
||File for configuring redirects|
||File used to start Solidus when it is deployed|
||File that dictates what files are ignored by git. This likely won't need any changes.|
We currently use Grunt to handle running the Solidus server.
grunt-init, uses a CLI. You can start your Solidus server in development mode by running:
This will compile any assets in
assets/, watch the
assets/ folder for changes, and run the Solidus server. The site should be accessible here: http://localhost:8080. To see the full list of tasks available, just type in
Initializing an existing site
If the site you need to work on already exists, the process is a bit simpler. Once you have Node.js and Grunt installed you're ready to start working on an existing site. Here's a quick run down of what to do:
- Copy the site to your local machine. If it's stored in git you'll want to clone it.
npm installin the website's directory. This will install the Node.js modules necessary to run the
gruntscripts the website has.
grunt dev. This will start the
gruntscript that runs all the development scripts.
- Go to http://localhost:8080