The Howdy marketing site. Written in Pug and deployed to Github pages. Caching/performance is provided by Cloudflare.
- Install node.js. You can get this from the official site, or via homebrew using nvm - node version manager (recommended).
- Clone this project to your local machine with
git clone git@github.com:weareleaf/leaf-site.gitfrom your terminal. - In your terminal
cdinto theleaf-siteproject - Type
npm installto install the node packages required to run the project.
npm run start // Start the development server with live rebuilding/reloading
npm run test // Run any JS tests
npm run build // Force a rebuild of all code
npm run deploy // Deploy the site to Github pages
So that you don't need to run the API locally to develop, if you include a ?staging=t query string parameter in your URL when viewing the site locally, the snippet generator and all associated pages should use the staging API and show URLs to the staging clientside JS.
If for whatever reason things won't work on your machine, it's most likely an issue with your node version or missing dependencies. Check your node version matches the version specified in .nvmrc using node -v and then reinstall your packages with rm -rf node_modules && npm cache clear && npm i.
Source code written in the ./code/ directory is converted and moved over to ./dist/ as part this template's build process. The following conversions are automated:
- Automatic compilation of Pug/Jade: Any
.pugor.jadefiles in./code/and its subdirectories will be converted. - Automatic compilation of Sass: Any
.scssfiles in./code/and its subdirectories will be converted. - Automatic compilation of JavaScript: A JS module starting from
./code/scripts/index.jswill be webpacked and minified into a single bundle. - Automatic optimisation of images: Any
.jpgfiles in./code/and its subdirectories will be optimised.