The project uses Handlebars and Grunt to generate static HTML pages from templates and JSON. The templates are stored in templates/ and are compiled into out/<user>. For example the index template is stored in templates/index.hbs and with Amy's data would compile to out/amy/index.html.
Partial templates are stored in templates/partials and are included into page templates.
Data for different users is stored in data/ and is compiled into templates.
The project uses SASS in the form of SCSS for styles. Source SCSS is stored in assets/sass and compiles then minifies to assets/css. The assets are copied to out/assets for use by compiled pages.
To build this project you will need:
To set up the project, begin by cloning the repository,
git clone https://github.com/bitHero/MyUVic
cd MyUVicInstall dependancies with the Node Package Manager (NPM),
npm installAssuming all dependancies installed correctly you can build the styles and pages with Grunt,
grunt buildIf you have issues with the previous command make sure you have the Grunt Command-Line Interface (CLI) installed globally (npm install -g grunt-cli).
Grunt will watch the files you're working on and automatically build any data, template or style changes just by running,
grunt
in the root of the project. This will build all the output files then watch for source file changes. In IntelliJ you can make this a Configuration after installing the Grunt plugin.
When developing the website locally it's best to run a simple a local server and view/inspect the website in a web browser (Google Chrome has great debugging tools for this). Python includes a module that can be used to run a server out of any local directory. To use this module you must have Python installed.
- Open a Terminal
cdto the directory you want to host, e.g.,out/amy/- Run
python -m SimpleHTTPServer