Project Base — basic pug template for lightning-fast layout ⚡⚡⚡
yarn install
gulp
src/assets
- all project assets (styles, scripts, pictures, fonts, etc.). They are copied to the dist/assets
folder, with preliminary parsing of pug templates, with minification and compilation of styles, as well as with a transpiler (babel), minification of scripts and image compression.
Here are:
sass
folder with mainstyle.sass
- project file with @import styles of all necessary blocks and fonts- the
js
folder with the main*.js
- project files with require scripts of all the necessary blocks (using the plugin syntax gulp-include) - folder
blocks
- blocks of pug templates, which are connected by include to templates and pages
To group blocks for other pages, it is recommended to use the @
prefix with the page name, for example, if the project has a about
page, the blocks can be put into the @about
folder.
- The builder passes the pug files in the
src
folder through the Pug template engine. - When
extends
is mentioned, processing of the template fromtemplate.pug
is enabled. - In the template, when
include
is found, the block template from the specified folder is parsed. - The compiled html files from the
src
folder are copied to thedist
folder.
- The builder passes sass files from the
src/assets
folders through the SASS templating engine. - Files with an underscore '_' specified with
@import
are included and compiled. Files without underscores are compiled automatically in alphabetical order. - Copy compiled css files to
dist/assets/css
.
- Files from
src/assets/blocks/*/img
,src/assets/img
folders are copied to thedist/assets/img/*
folder (block images are copied to the block folder).
- The builder passes js files from the
src/assets/js
folder through thegulp-include
plugin. - Babel - rewrites the code of the modern standard Javascript (ES2015) to a later one.
- From the
src/assets/js
andsrc/assets/libs/*.js
folders, the scripts pass through thegulp-uglify
plugin, which minifies the scripts. - Then, using the
gulp-concat
plugin, the scripts are combined into one common fileall.min.js
. - The compiled js file
all.min.js
is copied todist/assets/js
.