This repo is a boilerplate for Craft CMS. It uses Node, Grunt, Bower, and Bootstrap to generate template and asset files.
To get this project up and running, follow these steps:
- Make sure you've got Node installed on your system.
- Open a terminal and navigate to the project directory.
- Type
npm install
to install the project's back-end (Node/Grunt) dependencies. This might take a couple of minutes to finish. - Type
bower install
to install the project's front-end (Bower) dependencies. - Type
grunt
to build the template/asset files for the site and watch for changes to the files in thedev/
folder. If you're not interested in watching the project, typegrunt build
instead.
- Type
chmod -R 774 craft/{app,config,storage}
to make sure Craft can edit certain files. - Change the database settings in
craft/config/db.php
to point to an empty MySQL database that you control. - Make sure that the project is accessible on your local or remote server. Note: Craft will allow you to try out the two commercial tiers of its software if the domain name ends in
craft.dev
. With that in mind, it may be useful to develop locally using a domain pattern likehttp://projectname.craft.dev/
. - Open a browser and navigate to Craft's admin URL (e.g.
http://projectname.craft.dev/admin/
). This walkthrough will help you install Craft on your server.
The folder structure of this project looks like this:
./
bower/
[bower packages]
craft/
app/
config/
plugins/
storage/
templates/
dev/
assets/
css/
img/
js/
templates/
public/
assets/
uploads/
We develop our Craft templates in the dev/templates/
folder. Grunt minimizes these templates and stores the optimized files in the craft/templates/
folder.
We develop the project's front-end assets in the dev/assets/
folder. Our CSS is written in Sass and our JS is written in Coffeescript. Grunt compiles and optimizes these files, and then saves them to their appropriate CSS/JS locations in the public/assets/
folder.
We use Bootstrap on this project, but we've decided to take a 'piecemeal' approach to it. This workflow is kind of messy right now, but it's preferable to including all of Bootstrap regardless of what parts you're using.
To control which Bootstrap styles are included in the project, comment or uncomment lines in the file located at dev/assets/css/bootstrap.sass
. To control which Bootstrap scripts are included, open Gruntfile.coffee
and comment/uncomment the script lines within the concat:bootstrap_js
Grunt task. After modifying the script lines, it's a good idea to restart the Grunt watcher to make sure that it compiles those files correctly.