Skip to content

Getting Started

Eric Lanehart edited this page Jan 23, 2014 · 17 revisions

======

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:

  • Node.js, a version of Javascript that runs on servers instead of in the browser.
  • 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 ~/repos/solidus-site-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:

file/folder purpose
/assets Contains all your client side assets, like images, CSS, and Javascript.
/node_modules Special folder for Node.js modules. You won't need to interact with this at all
/preprocessors Contains resource preprocessors.
/views Contains all [[pages
Gruntfile.js File needed to configure grunt tasks. Generally doesn't need to be changed.
package.json Special files for Node.js modules. This probably won't need to be edited.
README.md An empty readme file. A good place to document the development of the site for whoever else might work on it.
redirects.json File for configuring redirects
start.js File used to start Solidus when it is deployed
.gitignore 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, like grunt-init, uses a CLI. You can start your Solidus server in development mode by running:

grunt dev

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 grunt -h:

grunt -h

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.
  • Run npm install in the website's directory. This will install the Node.js modules necessary to run the grunt scripts the website has.
  • Run grunt dev. This will start the grunt script that runs all the development scripts.
  • Go to http://localhost:8080

======

Solidus is still under development. If you have comments or questions, please reach out to us in our IRC channel: #solidus on irc.freenode.net

======