project-template

The best way to build static sites fast. Gulp + Browsersync + Handlebars.js + SCSS + more.

  • Owner: minimill/project-template
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

Project Template

Because web development doesn't need to be a pain.

The Minimill project template is the best way to build static sites fast. With one command, build a static page using Gulp, Handlebars.js, and SCSS.

Other Versions: ES6, Minimill internal

Features

  • Install the project in just three commands (see "Developing" below).
  • Use Handlebars.js to keep our HTML organized into templates and partials.
  • Use SCSS to keep our CSS organized into logical components.
  • Use Autoprefixer to automatically insert browser prefixes where necessary to handle cross browser compatibility.
  • Use Browsersync to automatically launch a development version of our website, reload the page whenever we change the HTML, and inject changes to CSS, JavaScript, and images with needing to reload.
  • Use HTML Minifier, CSSNano, UglifyJS, and ImageMin to compress and optimize our HTML, CSS, JavaScript, and images, respectively.
  • Use SCSS-Lint, JSHint, and JSCS to perform linting and style checking on our SCSS and JavaScript files.

All with one command from the terminal:

gulp serve

Setup

Install npm. Then, install gulp:

npm install -g gulp  # May require `sudo`

Developing

npm install            # One time
gem install scss_lint  # One time
gulp serve

Reminders

If you want to use this repo for your next project, make sure to make the following changes:

  1. Edit data.yml, filling in the HTML metadata associated with your site.
  2. Edit package.json providing a name, version, description, license, and repository.url.
  3. Remove the .git folder, so that you start from a fresh commit history.
  4. Edit LICENSE.md and README.md to your preference.

Gulp Commands

An overview of Gulp commands available:

gulp build

Builds the site into the dist directory. This includes:

  • SCSS w/ linting, sourcemaps and autoprefixing
  • JS linting and uglification
  • Handlebars to HTML

gulp build:optimized

This is used for distributing an optimized version of the site (for deployment). It includes everything from gulp build as well as:

  • SCSS minification
  • CSS / JS inline-sourcing

gulp watch

Watchs for changes in local files and rebuilds parts of the site as necessary, into the dist directory.

gulp serve

Runs gulp watch in the background, and serves the dist directory at localhost:3000 with automatic reloading using Browsersync.

Structure

├── Gulpfile.js       # Controls Gulp, used for building the website
├── README.md         # This file
├── data.yml          # Metadata associated with the site.
├── dist/             # Gulp builds the static site into this directory
├── package.json      # Dependencies
└── src/              # All source code
    ├── font/         # Font files
    ├── img/          # Images and SVGs
    ├── js/           # Javascript libraries and scripts
    ├── partials/     # Handlebars HTML partials that are included / extended
    ├── sass/         # Stylesheets
    └── templates/    # Handlebars HTML files, one per page on the site.

Main metrics

Overview
Name With Ownerminimill/project-template
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 3)
Platform
License:MIT License
所有者活动
Created At2015-11-11 23:07:40
Pushed At2023-05-07 22:25:34
Last Commit At
Release Count0
用户参与
Stargazers Count82
Watchers Count3
Fork Count19
Commits Count32
Has Issues Enabled
Issues Count11
Issue Open Count1
Pull Requests Count5
Pull Requests Open Count14
Pull Requests Close Count9
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private