generator-pixel2html v2.0.0
Pixel2HTML Boilerplate Generator 2.0.0
We aim to generate a boilerplate code for projects when we know the specs. š
How to install
Node
You will need node installed in your machine. In case you don't have it (you can check this typing node --version in your terminal) please visit this link.
We also need to install Yeoman, and the Pixel2HTML Generator, so run this command in your terminal. The -g parameter is to install them globally so can use it in every project.
$ npm install -g yo generator-pixel2htmlRuby
If you plan is generate a site with Jekyll you also need Ruby and Bundler up & running.
You can check if Ruby is installed running ruby --version
We recommend to use the latest stable version (2.4.2). If you need more information please check on ruby official site or rvm to handle multiple versions of Ruby.
Also, for Bundler, run gem install bundler when Ruby is already installed and running.
Running the generator
To generate the Pixel2HTML Boilerplate go to your project folder and run this command in your shell
$ cd ~/your/project/folder
$ yo pixel2htmlThe Pixel2HTML Boilerplate will ask you questions about this points. Answering with the desired options will generate the code.
- Project Name?
- Quantity of screens?
- Markup Language? Options: HTML/Pug
- Markup Integration? Options: None/Jekyll
- Frontend Framework Options: None/Bootstrap/Foundation
- jQuery? Options: true/false
There are also two more way to generate your files, you can find the instructions in the (Wiki)https://github.com/Pixel2HTML/pixel2html-generator/wiki/Running-the-Pixel2HTML-Generator
Installing dependencies & running up
To work, the Pixel2HTML Boilerplate needs to install some dependencies to run the options you select. For this job, run this command in your shell
$ npm run startGenerated file structure
This boilerplate will create a set of files and folders
āāā dist/
āāā gulp/
āāā src/
ā āāā assets/
ā ā āāā fonts/
ā ā āāā icons/
ā ā āāā images/
ā ā āāā js/
ā ā āāā styles/
ā ā ā āāā components/
ā ā ā ā āāā _buttons.scss
ā ā ā ā āāā _footer.scss
ā ā ā ā āāā _forms.scss
ā ā ā ā āāā _header.scss
ā ā ā ā āāā _nav.scss
ā ā ā āāā screens/
ā ā ā ā āāā _base.scss
ā ā ā ā āāā screen_*.scss
ā ā ā āāā _mixins.scss
ā ā ā āāā _reset.scss
ā ā ā āāā _variables.scss
ā ā ā āāā main.scss
ā ā ā āāā vendor.scss
ā āāā screen_*.[html|pug]
āāā .editorcofig
āāā .gitattributes
āāā .gitignore
āāā .project.conf
āāā gulpfile.js
āāā package.json
āāā README.mdHow to work with script files
We are using WebpackJS to bundle our script files. There's also ES6 on-demand transpilation and polyfills.
Learn more about Javascript Modules here Wes Bos Article About Modules
Example
import $ from 'jquery'
import 'bootstrap-sass'We also included the amazing webpack-bundle-analyzer you can fine tweak you JS bundle size if you wish to. Fire it up running this command:
$ npm run debugAvailable script commands.
Start to code.
$ npm run code
Build the project
$ npm run build
Available Gulp Commands
Helpers
$ gulp cleanClean /dist directory
Static Files
$ gulp main:staticCompile static files (images, icons)$ gulp main:imagesMove images$ gulp main:iconsMove icons
Fonts Files
$ gulp main:fontsMove project fonts$ gulp vendor:fontsMove vendors fonts
Scripts
$ gulp main:scriptsConcat, uglify and move project JS files$ gulp vendor:scriptsConcat, uglify and move vendors JS files
Styles
$ gulp main:stylesCompile, concat, autoprefix and move SCSS, Less, Stylus project files$ gulp vendor:stylesCompile, concat, autoprefix and move SCSS, Less, Stylus vendor files
Integration
$ gulp jekyll:buildCompile markup with Jekyll's partials and layouts files.
Delivery
$ gulp buildExecute all the gulp directives and makes a.zipfile with the latest code.$ gulp releaseExecute all the gulp directives and makes a.zipfile with the latest code.$ gulp release --prodExecute all the gulp directives, prepare assets to production and makes a.zipfile with the latest code.
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago