#LeadPages™ Template Build System
The LeadPages™ Template Build System is for templates authoring to be sold on the LeadPages™ Marketplace.
This Build System will work for both existing or new LeadPages™ templates. If you are concern that this will overwrite your existing project, don't worry. The following installation script will check if you have an existing leadpages-template folder, if it does, it'll leave your leadpages-template alone and just grab the necessary build system files. Otherwise, it'll grab a new skeleton leadpages-template for you. Lastly, it'll also initialized a clean git repository for you.
##IMPORTANT: Before You Begin
If you are installing this build system as a standalone (meaning not using Yeoman):
If you are using either sass or less with your existing template, either copy the contents of /leadpags-template/css/style.css into template.scss/less or make a copy to include it in template.scss/less. Because gulp start will overwrite your /leadpages-template/css/style.css!!
Very much the same reason as style.css above. If you don't want to have all of your JS inside the scripts folder, you can just remove the scripts folder. If you do, make sure you move the contents in functions.js to scripts/app/somefile.js.
##Installation
###Requirements
- Bash Terminal
- Mac
It comes with all Mac's. Just hit
command+spaceand typeterminaland hitenterto launch it - Windows Download and install Git SCM
- Mac
It comes with all Mac's. Just hit
- NodeJS
If you are starting fresh, try our yeoman generator that it comes with the LeadPages™ Build System!
- Open up your Terminal or GitSCM Bash Terminal (Windows)
cdinto your root directory where you have theleadpages-templatefoldergit clone https://github.com/LeadPages/LeadPagesBuildSystem .(The . at the end is important!)
- Or download a zip file here and unzip to outside of
leadpages-templatefolder
- In the terminal, run
./install - Before you type
gulp start, please read the IMPORTANT: Before You Begin section - Type
gulp startin the terminal to start- If your default browser doesn't launch automatically. Point your browser to
http://localhost:8080
- If your default browser doesn't launch automatically. Point your browser to
- Done!
Why have a separate set of instructions? This is one way to make sure we don't overwrite any of your stuff.
cdinto your root directory where you have theleadpages-templatefoldergit clone https://github.com/LeadPages/LeadPagesBuildSystem
- Or download a copy of the zip file here and unzip and copy the contents over
cd LeadPagesBuildSystem && ./installcd ..Even after the folders were deleted, Bash script can only executes in the current directory so it can'tcdup one level.npm install- Before you type
gulp start, please read the notes in IMPORTANT: Before You Begin section - Type
gulp startin the terminal to start coding
- If your default browser doesn't launch automatically. Point your browser to
http://localhost:8080
- Done!
##Available Gulp Tasks
gulporgulp help: Show available gulp tasksgulp start:connect,open(the default browser),watch- If your default browser doesn't launch automatically. Point your browser to
http://localhost:8080
- If your default browser doesn't launch automatically. Point your browser to
gulp build:- combine
functions.jsfromscripts/app/*.jsif.scriptsfolder exists and wrap them with jQuerydocreadyandwindow.load - combine
vendor.jsfromscripts/vendor/**/*.jsif.scriptsfolder exists. jquery-1.9.1.min.js is always included first, you can also delete it if you don't want jQuery
- combine
gulp zip: Make a copy ofleadpages-template, then minify css/js before zipping up theleadpages-template.zipfolder for easy upload!
(Note: you would still need to manually update thenotesandversionintemplate.json.)
##Folders Structure Notes
To give you a better idea how to work this build system, please refer below for the files structure. But in general:
- You would edit
index.htmldirectly inside./leadpages-template/folder - If you are not using less or sass, you would edit
style.cssdirectly inside the./leadpages-templatefolder - If you don't want to combine JS into a single file (as functions.js / vendor.js) or
scriptsfolder doesn't exist, you would editfunctions.jsor your desired JS files directly. - SASS, LESS, and JS have their respective folders and see below for more explanations.
- All css/js within
/leadpages-template/files will be minify regardless of the above options before zipping.
Your Template Folder
| --- index.html
| --- build/ (A temp folder generated by the `copy` task for debugging purpose and minifications before zipping)
| --- images/ (All images below this folder will be optimized & copied to `./leadpages-template/img/`)
| --- gulp/
| --- tasks/
| | --- (Files within here are all of the gulp tasks. You can customize to fit your work flow!)
| --- gulfile.js (DO NOT REMOVE)
| --- leadpages-template/
| | --- css/
| | | --- style.css (Compiled from either the "scss" or "less" folder OR edit directly if no SASS or LESS is used)
| | --- fonts/
| | --- img/
| | --- js/
| | | --- html5shiv.js (required by LeadPages)
| | | --- functions.js (output from the "scripts/app" folder)
| | | --- vendor.js (output from the "scripts/vendor" folder)
| | --- meta/
| | | --- template.json
| --- less (You can delete this if you prefer SASS or Yeoman will clean this up for you)
| | --- _settings.colors.less (Base colors: font colors, background etc...)
| | --- _settings.global.less (variables for fonts etc...)
| | --- mixins/
| | | --- css3.less (Mixins examples)
| | --- template.less (Put your custom css here or import others in here.)
| --- node_modules (Added to .gitignore and DO NOT REMOVE)
| --- package.json (DO NOT REMOVE)
| --- scripts/ (If you prefer NOT to organize your JS files here. Delete it.)
| | --- app/ (JS in here will output to `leadpages-template/js/functions.js`)
| | | --- something.js
| | --- vendor/ (JS in here will output to `leadpages-template/js/vendor.js`)
| | | --- jquery.1.9.1.min.js (And other 3rd party scripts. jQuery will always include first)
| | --- scripts-footer.js (Do not remove! Use for wrapping `function.js`)
| | --- scripts-header.js (Do not remove! Use for wrapping `function.js` and you can add `global` variables on top of this file)
| --- scss/ (You can delete this if you prefer LESS or Yeoman will clean this up for you)
| | --- _settings.colors.scss (Base colors: font colors, background etc...)
| | --- _settings.global.scss (variables for fonts etc...)
| | --- mixins/
| | | --- css3.scss (Mixins examples)
| | --- template.scss (Put your custom css here or import others in here.)
##Questions? Issues? Comments?
Please report them using this repo's Issues Tracker.
##Contribute
Don't have all the stuff you want? You can always fork a branch!
- Fork a feature branch
- Code
- Submit a Pull Request
- Thank you for helping out! You're awesome!
##Important notes for the yeoman branch
Please note that this branch is meant for using with the Yeoman generator that MAKE SURE you create a local yeoman branch and do a Pull Request with this branch ONLY. The difference is that the yeoman branch has the leadpages-template folder and minor readme details like this one.
If you are pulling changes from master from other branches (such as updating the gulp tasks), make sure you keep the leadpages-template folder otherwise you'd break the ./install script on master. How? git co [commit before your merge hash] leadpages-template to bring it back.
Best practice: merge your test changes on a separate branch.