This is the Nation Builder theme used by jlm2017.fr , the website of Jean-Luc Mélenchon campaigns for French Presidential Elections.
This repository uses Bower to manage dependencies, and Gulp as build system.
It separates building and deployment phase. It replaces the flat folder structure that NB uses by default by a logical hierarchy.
It must be used in conjunction with the official NationBuilder Theme Sync for Mac or with the NationSync CLI tool.
We assume that you have in /somedir/theme-xxx the directory containing the theme you are working on. This is the flat version downloaded from NB.
You should use one of the synchronization tool to keep you website up to date with this directory.
First move to another directory, and clone the repository :
git clone https://github.com/guilro/jlm2017-nb-theme.git my_theme
Install dependencies :
cd my_theme
npm install
bower install
Then, create a symbolic link from the build destination of the theme to the synchronized folder :
ln -s /somedir/theme-xxx dist/theme
Start editing the theme in the src
directory. When you want to build you changes to the synchronized folder, run :
npm run build
You can use npm run watch
to watch for changes in the theme and update in real time.
A Vagrant development environment is maintained to ease administration tasks. Take a look at Vagrant website to get started and install apps. Then:
vagrant up
It will take some time to download clean image and install dependencies.
Then connect to the machine:
vagrant ssh
Your development sources will stay in sync in /vagrant directory. You can now start to work:
vagrant ssh
cd /vagrant/
npm run build
Note: Nationsync package is installed. See https://github.com/jlm2017/nationsync to configure. Then, you can:
vagrant ssh
cd /vagrant/dist/theme
nationsync watch
The official theme documentation of NationBuilder is very rich and a good source of information, even if it is incomplete and full of error.
Another very good source of knowledge is the default theme of NationBuilder, which serves as basis for this theme, and use most of the features offered.