The URN WordPress theme
Note: The following presumes that you already have a mysql and apache server installed locally.
- Install Node.js from https://nodejs.org/en/ then run
npm installfrom the command line at the project root
npm install -g grunt-clito install grunt and grunt plugins
- Install Ruby for your OS and make sure to check the option to add it to your PATH variable if on Windows
gem update --system
gem install scss_lint
npm install grunt-scss-lint
gem install compass
npm install grunt-contrib-compass
gruntfrom the command line within the project directory to start watching the project
- Grunt should now compile your CSS as you edit the SCSS files
Presuming you're running a linux system, get a complete mirror of the live WordPress database locally.
urnssh alias set
- Set the
$URNLOCALenvironment variable to the local development url (e.g.
- Local MySQL username:
- Local MySQL password:
Keep tasks running even if the SCSS lint fails (useful for development when CSS is still in-progress but make sure the linter passes before committing any SASS)
In order for pushes to this repository (and child theme repositories) to automatically update the live version of the site, a webhook is used to send a POST request to http://urn1350.net/hook.php when commits are pushed. The
hook.php script then executes
<?php echo shell_exec('../pull.sh');
#!/bin/sh cd /var/www/html/wp-content/themes/urn-material; git checkout master; git pull 2>&1; echo '<br>'; cd /var/www/html/wp-content/themes/urn-material-su-elections; git checkout master; git pull 2>&1; echo '<br>'; cd /var/www/html/wp-content/themes/urn-material-varsity; git checkout master; git pull 2>&1; echo '<br>';