Skip to content
/ gulp-site-template Public template

A site template using the build tool Gulp, as well as several of its plugins, to speed up website building and automate several of its tasks.

Notifications You must be signed in to change notification settings

shirblc/gulp-site-template

Repository files navigation

Empty Site

Known Vulnerabilities Libraries.io dependency status for GitHub repo

Version

Version 1.

Desciption

An empty site template for any use. Comes fully equipped with Gulp and several of its plugins (see Dependencies) to make your workflow quicker. Largely based on Udacity's Web Tooling and Automation course.

Important! This version was built for Adobe Dreamweaver or Adobe Brackets users. Therefore it doesn't include several important tools:

  1. Linting - Both Dreamweaver and Brackets have linting built into their interface, using the popular ESLint. As such, there was no need to install the Gulp-ESLint extension.
  2. Live Editing - Both Dreamweaver and Brackets have Live Editing built into their interface (as "Real-time Preview". As such, there was no need to install the BrowserSync extension.
  3. Sass - Both Dreamweaver and Brackets come with a build-in Sass/SCSS/Less conversion tool. As such, there was no need to install the Gulp-Sass extension.

Requirements

  • Node.js

Installation and Usage

Master Branch

  1. Download or clone the repo.
  2. cd into the project directory.
  3. Run npm install.
  4. Set up your tests in the Jasmine specs folder.
  5. Start building. Don't forget to add each JavaScript file you create to the concatenation order in the Gulp tasks 'scripts' and 'scripts-dist'.

Unit-Testing-Manual Branch

  1. Download or clone the repo.
  2. cd into the project directory.
  3. Run npm install.
  4. Set up your tests in the Jasmine tests folder and get specRunner.html running.
  5. Start building. Don't forget to add each JavaScript file you create to the concatenation order in the Gulp tasks 'scripts' and 'scripts-dist'.

Contents

Development Mode

The Developmnt Mode folder (parent folder) includes:

  1. CSS Folder - For Sass files output.
  2. Sass Folder - For the project's Sass files.
  3. JS Folder - For all scripts.
  4. IMG Folder - For all images.
  5. Tests Folder (unit testing branches only) - For Jasmine spec files.
    • Master - Contains only the JavaScript specs file. The specRunner will open once you run the gulp testing task.
    • unit-testing-manual - Contains the Jasmine library, the specRunner and whatever specs files you add.
  6. Dist Folder - See "Production Mode"

As well as the files:

  1. gulpfile.js - JavaScript file containing the tasks for gulp to perform.
  2. index.html - The base HTML file.
  3. package.json and package-lock.json - NPM files including all the required dependencies. To install, run npm install.
  4. README.md - This file.

Production Mode

To make it easier to prerpare for distribution, the site includes a seperate distribution folder, to the files are exported once they're run through Gulp. This is the "dist" folder. The distribution folder already includes a CSS folder and a JS folder, for the site's CSS and JavaScript (respectively). A Gulp task deals particulalry with adding the photos folder and the index HTML file to the distribution folder every time they're changed.

Dependencies

The site uses several tools to maximize compatibility:

  1. Gulp - Gulp enables running tasks automatically. You can read more on the Gulp website. Gulp is a Node.js tool, so it requires installing Node.
  2. Gulp-Postcss with Autoprefixer Plugin - A Gulp plugin which adds the necessary browser prefixes to the CSS file. For more info check the Gulp-postcss page and the Autoprefixer page on NPM.
  3. Gulp-Babel - A Gulp plugin for the transpiler Babel. Converts the current ES version to the highly supported ES5. For more info check the plugin's GitHub repository.
  4. Gulp-Concat - A Gulp plugin which combines all the ES5 JavaScript (Babel's output) files into one file. For more info check the Gulp-concat page on NPM.
  5. Gulp-Uglify - A Gulp plugin which minimises the single JavaScript file (Concat's output). For more info check the Gulp-uglify page on NPM.
  6. Gulp-Sourcemaps - A Gulp plugin utilizing the source maps tool. For more info check the Gulp-sourcemaps page on NPM.
  7. Gulp-order - A gulp plugin to set the order in which the JavaScript files will be concatenated. For more info, check the Gulp-order GitHub page.
  8. Jasmine - An open-source behaviour-driven testing framework. For more information, check Jasmine's official site. Included packages:
    • jasmine-core
    • jasmine-spec-reporter
  9. Karma - An open-source test-runner, used to run the tests on various devices with a test server. For more information, check Karma's official site. Included packages:
    • karma
    • karma-jasmine - A Karma adapter for the Jasmine framework. Project repo.
    • karma-jasmine-html-reporter - A reporter that shows test results in HTML. NPM page..
    • karma-chrome-launcher - A launcher for Chrome, Chrome Canary and Chromuim. Project repo..
    • karma-coverage - Code coverage generator. Project repo.
    • karma-coverage-istanbul-reporter - Code coverage generator reporter. NPM page.
    • karma-sourcemap-loader - A preprocessor that loads existing source maps. NPM page.

Tests

There's a test file in tests/specs.js, in which all site tests are written. The Karma test runner then runs this tests file against the final distribution version of the site's script. Tests are run using gulp unitTest.

Known Issues

There are no current issues at the time.

About

A site template using the build tool Gulp, as well as several of its plugins, to speed up website building and automate several of its tasks.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages